{"id":836,"date":"2016-10-24T15:22:38","date_gmt":"2016-10-24T14:22:38","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=836"},"modified":"2016-10-24T15:23:26","modified_gmt":"2016-10-24T14:23:26","slug":"taking-strace-output-stderr-piping-utilities","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2016\/10\/24\/taking-strace-output-stderr-piping-utilities\/","title":{"rendered":"Taking strace output from stderr and piping to other utilities"},"content":{"rendered":"<p>Well, this is a strange thing to do, but say you want to know how fast an application is processing data. how to tell? Enter strace, and&#8230; a bit of wc -l with the assistance of tee and 2>&#038;1 proper redirection.<\/p>\n<pre>\r\nstrace -p 9653 2>&1 | tee >(wc -l)\r\n\r\n<\/pre>\n<p>where 9653 is the process id (pid) and wc -l is the command you want to pipe to!<\/p>\n<pre>\r\nread(4, \"2.74.2.34 - - [26\/05\/2015:15:15\"..., 8192) = 8192\r\nread(4, \"o) Version\/7.1.6 Safari\/537.85.1\"..., 8192) = 8192\r\nread(4, \"ident\/6.0)\\\"\\n91.233.154.8 - - [26\"..., 8192) = 8192\r\n^C1290\r\n<\/pre>\n<p>1290 lines in the output.. perfect, thats what I wanted to know, roughly how quickly this log parser is going thru my logs \ud83d\ude00<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, this is a strange thing to do, but say you want to know how fast an application is processing data. how to tell? Enter strace, and&#8230; a bit of wc -l with the assistance of tee and 2>&#038;1 proper &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2016\/10\/24\/taking-strace-output-stderr-piping-utilities\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,34,15,9],"tags":[],"class_list":["post-836","post","type-post","status-publish","format-standard","hentry","category-bash","category-cdn","category-cloud","category-linux"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=836"}],"version-history":[{"count":2,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/836\/revisions"}],"predecessor-version":[{"id":838,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/836\/revisions\/838"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}