From mboxrd@z Thu Jan 1 00:00:00 1970 From: miloody@gmail.com (loody) Date: Sun, 30 Jan 2011 16:07:35 +0800 Subject: can we measure the traffic between user and kernel mode In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org hi: 2011/1/28 Alexandre Courbot : >> I can "strace -o -tt 123 a.out" before "A begin" but how could I >> combine console output with the content of strace? > > strace does output to stderr unless you specify the -o option. So by > using something like > > $ strace -tt your_program > > or > > $ strace -tt your_program &> log.txt > > you will have both outputs intermingled. Note that the console output > of your program will appear in the middle of the corresponding write() > system call. I have tried both ways you mentioned. in case 1: it did interleave the output of standard output with standard error. in case 2: the standard output seems will be collect for flush at later, combine.strace.txt. (I attach the testing result for your reference.) theoretically, file re-direction should not be effect the content of output, right? appreciate your help :-) miloody. -------------- next part -------------- A non-text attachment was scrubbed... Name: strace.output.tar.bz2 Type: application/x-bzip2 Size: 1882 bytes Desc: not available Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110130/5b02b45e/attachment.bz2