All of lore.kernel.org
 help / color / mirror / Atom feed
* [Question] How does perf still record the stack of a specified pid even when that process is interrupted and CPU is scheduled to other process
@ 2015-04-24 13:31 Yunlong Song
  2015-04-24 13:49 ` Yunlong Song
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Yunlong Song @ 2015-04-24 13:31 UTC (permalink / raw)
  To: a.p.zijlstra, paulus, mingo, Arnaldo Carvalho de Melo
  Cc: linux-kernel, wangnan0

[Profiling Background]
Now we are profiling the performance of ext4 and f2fs on an eMMC card with iozone,
we find a case that ext4 is better than f2fs in random write under the test of
"iozone -s 262144 -r 64 -i 0 -i 2". We want to analyze the I/O delay of the two
file systems. We have got a conclusion that 1% of sys_write takes up 60% time of
the overall sys_write (262144/64=4096). We want to find out the call stack during
this specific 1% sys_write. Our idea is to record the stack in a certain time period
and since the specific 1% case takes up 60% time, the total number of records of its
stack should also takes up 60% of the total records, then we can recognize those stacks
and figure out what the I/O stack of f2fs is doing in the 1% case.

[Profiling Problem]

Although perf can record the events (with call stack) of a specified pid, e.g. using
"perf record -g iozone -s 262144 -r 64 -i 0 -i 2". But we find iozone is interrupted
and the CPU is scheduled to other process. As a result, perf will not record any events
of iozone until iozone's context is recovered and the CPU is scheduled to continue
processing the sys_write of iozone. This obeys our initial idea which is described in
[Profiling Background], since we cannot recognize the call stacks of the specific 1% case
by using the ratio of the record number.

[Alternative Solution without Perf]
We can use /proc/#pid/stack to record the stack in a certain period (e.g. 1ms) of iozone,
no matter whether iozone is interrupted or not. However, we have not taken a deep sight
into this, since we want to use perf to do this kind of thing.

[Question about Perf]
So we have a question that "How does perf still record the stack of a specified pid even
when that process is interrupted and CPU is scheduled to other process?"

-- 
Thanks,
Yunlong Song


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-05-06  4:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-24 13:31 [Question] How does perf still record the stack of a specified pid even when that process is interrupted and CPU is scheduled to other process Yunlong Song
2015-04-24 13:49 ` Yunlong Song
2015-04-25 14:03   ` Yunlong Song
2015-04-24 13:49 ` David Ahern
2015-04-24 13:56   ` Yunlong Song
2015-04-24 13:58 ` David Ahern
2015-04-25 14:05   ` Yunlong Song
2015-04-25 15:53     ` David Ahern
2015-05-05 21:53       ` Rabin Vincent
2015-05-05 22:24         ` David Ahern
2015-05-06  4:13         ` Yunlong Song
2015-05-06  4:10       ` Yunlong Song

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.