Skip to contentSkip to conversation

Collect Per thread event count using perf

DISCUSSION Hemendra Rawat 2 participants 2 messages Oct 29, 2014

lore
Share & tools
lore
#0 lore raw

Hi,

I'm new to perf. I want to use perf to collect cpu-cycles spent in each function for a multi-threaded program (Nasa Parallel Bench marks OpenMP version).

I'm using following commands to record and analyze the data.

            # perf record -s --call-graph=dwarf ./my-program 10
            # perf report -T --call-graph=graph     

But the TUI interface that opens up doesn't give information on a per thread basis. It's all aggregate event count for each function. I'm not sure whether i'm recording the data in the wrong way or I'm missing something in the interpretation of perf output. Can someone help me with this ? Any help will be highly appreciated.

Thanks
Hemendra

#1 lore raw

Hi Hemendra,

Quoted 8 lines · Hemendra Rawat

Hi,

I'm new to perf. I want to use perf to collect cpu-cycles spent in each function for a multi-threaded program (Nasa Parallel Bench marks OpenMP version).

I'm using following commands to record and analyze the data.

Quoted 8 lines
            # perf record -s --call-graph=dwarf ./my-program 10
            # perf report -T --call-graph=graph     

But the TUI interface that opens up doesn't give information on a per thread basis. It's all aggregate event count for each function. I'm not sure whether i'm recording the data in the wrong way or I'm missing something in the interpretation of perf output. Can someone help me with this ? Any help will be highly appreciated.

It seems only --stdio support the -T option (and recorded events have 'S' modifier?). What about using "perf report -s pid"?

And I have a question to others: I always get confused with "perf record -s". It turns on the inherit_stat attribute, and what it does looks like sharing event value/stat with other tasks - but I maybe mis- understood something. Could anyone please explain it to me in more detail? Also it'd be better if the related man page also can be updated.

Thanks,
Namhyung