Description of problem: Perf timechart doesn't work for me - trying to follow the man page just gets me a usage message. Version-Release number of selected component (if applicable): kernel-2.6.32.9-67.fc12.i686 perf-2.6.32.9-67.fc12.noarch How reproducible: # perf timechart record ls usage: perf record [<options>] [<command>] or: perf record [<options>] -- <command> [<options>] -e, --event <event> event selector. use 'perf list' to list available events -p, --pid <n> record events on existing pid -r, --realtime <n> collect data with this RT SCHED_FIFO priority -R, --raw-samples collect raw sample records from all opened counters -a, --all-cpus system-wide collection from all CPUs -A, --append append to the output file to do incremental profiling -C, --profile_cpu <n> CPU to profile on -f, --force overwrite existing data file -c, --count event period to sample -o, --output <file> output file name -i, --inherit child tasks inherit counters -F, --freq <n> profile at this frequency -m, --mmap-pages <n> number of mmap data pages -g, --call-graph do call-graph (stack chain/backtrace) recording -v, --verbose be more verbose (show counter open errors, etc) -s, --stat per thread counts -d, --data Sample addresses -n, --no-samples don't sample -M, --multiplex multiplex counter output in a single channel
Same problem on the 20100318 nightly image. kernel-2.6.33-1.fc13.i686 perf-2.6.33-1.fc13.noarch Am I doing something wrong? "perf timechart" is mentioned in the alpha release notes so it must work, right?
I investigated with gdb. Perhaps the perf events that timechart uses are not available? I don't see power or sched in 'perf list'. # gdb /usr/libexec/perf.2.6.32.11-99.fc12.i686 (gdb) set args timechart record ls (gdb) directory /usr/src/debug/kernel-2.6.32/linux-2.6.32.i686/tools/perf/ (gdb) break exit (gdb) run Starting program: /usr/libexec/perf.2.6.32.11-99.fc12.i686 timechart record ls [Thread debugging using libthread_db enabled] usage: perf record [<options>] [<command>] or: perf record [<options>] -- <command> [<options>] -e, --event <event> event selector. use 'perf list' to list available events -p, --pid <n> record events on existing pid -r, --realtime <n> collect data with this RT SCHED_FIFO priority -R, --raw-samples collect raw sample records from all opened counters -a, --all-cpus system-wide collection from all CPUs -A, --append append to the output file to do incremental profiling -C, --profile_cpu <n> CPU to profile on -f, --force overwrite existing data file -c, --count event period to sample -o, --output <file> output file name -i, --inherit child tasks inherit counters -F, --freq <n> profile at this frequency -m, --mmap-pages <n> number of mmap data pages -g, --call-graph do call-graph (stack chain/backtrace) recording -v, --verbose be more verbose (show counter open errors, etc) -s, --stat per thread counts -d, --data Sample addresses -n, --no-samples don't sample -M, --multiplex multiplex counter output in a single channel Breakpoint 1, exit (status=129) at exit.c:99 99 { (gdb) bt #0 exit (status=129) at exit.c:99 #1 0x08063978 in usage_with_options (argc=18, argv=0x8592068, options=0x8119320, usagestr=0x81195f0, flags=2) at util/parse-options.c:501 #2 parse_options (argc=18, argv=0x8592068, options=0x8119320, usagestr=0x81195f0, flags=2) at util/parse-options.c:389 #3 0x08054e54 in cmd_record (argc=18, argv=0x8592068, prefix=0x0) at builtin-record.c:723 #4 0x0804af33 in run_builtin (p=0x8148b3c, argc=3, argv=0xbffff658) at perf.c:262 #5 0x0804bc61 in handle_internal_command (argc=3, argv=0xbffff658) at perf.c:321 #6 run_argv (argc=3, argv=0xbffff658) at perf.c:365 #7 main (argc=3, argv=0xbffff658) at perf.c:482 (gdb) frame 2 #2 parse_options (argc=18, argv=0x8592068, options=0x8119320, usagestr=0x81195f0, flags=2) at util/parse-options.c:389 389 usage_with_options(usagestr, options); (gdb) list 384 if (ctx.argv[0][1] == '-') { 385 error("unknown option `%s'", ctx.argv[0] + 2); 386 } else { 387 error("unknown switch `%c'", *ctx.opt); 388 } 389 usage_with_options(usagestr, options); 390 } 391 392 return parse_options_end(&ctx); 393 } (gdb) print ctx.argv[0] $1 = 0x8592218 "power:power_start"
Tested with the 20100428 kde nightly - ie kernel-2.6.33.2-57.fc13 - in virtualbox. Neither 'perf record sched ls' or 'perf record timechart ls' work, but at least now they report missing perf events before printing the usage message.
This is working for me on 2.6.33.3-85.fc13.x86_64... kyle@dreadnought ~/src $ sudo perf timechart record ls 9base elfutils libnl rpm <snip> DeviceKit-power iproute2 perf.data xrandr dracut klibc pixman xserver dwm koji PolicyKit e2fsprogs libbsd pyclutter eagle libdrm razor [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.383 MB perf.data (~16724 samples) ] kyle@dreadnought ~/src $ sudo perf timechart -i ./perf.data Written 0.1 seconds of trace to output.svg. kyle@dreadnought ~/src $ Am I missing something?
Got it - perf doesn't mount debugfs. Immediately after boot, perf timechart doesn't work. But after running latencytop, it does. # perf list | wc -l 52 # latencytop # perf list | wc -l 802
Aaaah cool... I'll see about getting a printf in there to warn you that debugfs isn't mounted. regards, Kyle
Actually, I think I googled up something about this yesterday. Ah yes, http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29c52aa2300173dd45df04dae1f5acc81a2c93b1 Doesn't seem to be in 2.6.32 or 2.6.33 trees.