aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2012-07-23perf symbols: Add machine id to modules debug messageDavid Ahern1-2/+9
Current debug message is: Problems creating module maps, continuing anyway... When running multiple VMs it would be nice to know which machine the message is referring to: $ perf kvm --guest --guestmount=/tmp/guest-mount record -av -- sleep 10 Problems creating module maps for guest 6613, continuing anyway... Signed-off-by: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-07-20ktest: Reset saved min (force) configs for each testSteven Rostedt1-0/+2
The min configs are saved in a perl hash called force_configs, and this hash is used to add configs to the .config file. But it was not being reset between tests and a min config from a previous test would affect the min config of the next test causing undesirable results. Reset the force_config hash at the start of each test. Signed-off-by: Steven Rostedt <[email protected]>
2012-07-19tools/power: turbostat: fix large c1% issueLen Brown1-4/+8
Under some conditions, c1% was displayed as very large number, much higher than 100%. c1% is not measured, it is derived as "that, which is left over" from other counters. However, the other counters are not collected atomically, and so it is possible for c1% to be calaculagted as a small negative number -- displayed as very large positive. There was a check for mperf vs tsc for this already, but it needed to also include the other counters that are used to calculate c1. Signed-off-by: Len Brown <[email protected]>
2012-07-19tools/power: turbostat v2 - re-write for efficiencyLen Brown3-539/+868
Measuring large profoundly-idle configurations requires turbostat to be more lightweight. Otherwise, the operation of turbostat itself can interfere with the measurements. This re-write makes turbostat topology aware. Hardware is accessed in "topology order". Redundant hardware accesses are deleted. Redundant output is deleted. Also, output is buffered and local RDTSC use replaces remote MSR access for TSC. From a feature point of view, the output looks different since redundant figures are absent. Also, there are now -c and -p options -- to restrict output to the 1st thread in each core, and the 1st thread in each package, respectively. This is helpful to reduce output on big systems, where more detail than the "-s" system summary is desired. Finally, periodic mode output is now on stdout, not stderr. Turbostat v2 is also slightly more robust in handling run-time CPU online/offline events, as it now checks the actual map of on-line cpus rather than just the total number of on-line cpus. Signed-off-by: Len Brown <[email protected]>
2012-07-19ktest: Add check for bug or panic during rebootSteven Rostedt1-1/+27
Usually the target is booted into a dependable kernel when a test starts. The test will install the test kernel and reboot the box. But there may be a time that the kernel is running an unreliable kernel and the reboot may crash. Have ktest detect crashes on a reboot and force a power-cycle instead. This can usually happen if a test kernel was installed to run manual tests, but the user forgot to reboot to the known good kernel. Signed-off-by: Steven Rostedt <[email protected]>
2012-07-19ktest: Add MAX_MONITOR_WAIT optionSteven Rostedt2-1/+23
If the console is constantly outputting content, this can cause ktest to get stuck waiting on the monitor to settle down. The option MAX_MONITOR_WAIT is the maximum time (in seconds) for ktest to wait for the console to flush. Signed-off-by: Steven Rostedt <[email protected]>
2012-07-19ktest: Fix config bisect with how make oldnoconfig worksSteven Rostedt1-0/+46
With a name like 'oldnoconfig' one may think that the config generated would disable all configs that were not defined (selecting "no" for all options). But this is not the case. It selects the default. If a config has a 'default y', then it is added if not specified. This broke the config bisect, because options not specified by a config will just use the default, where it expected to turn off. This caused an option to be enabled that disabled an option that would break the build. The end result was that we never found the bad config at the end of the test. Instead of using 'make oldnoconfig', ktest now builds the options it expects enabled and disabled. When it turns off an option, it will no longer remove it, but actually set it to: # CONFIG_FOO is not set. Signed-off-by: Steven Rostedt <[email protected]>
2012-07-19ktest: Add CONFIG_BISECT_CHECK optionSteven Rostedt2-0/+20
The config-bisect can take a bad config and bisect it down to find out what config actually breaks the config. But as all tests will apply a minconfig (defined by a user) to apply before booting, it is possible that the minconfig could actually make the bad config work (minconfigs can disable configs). The end result is that the config bisect test will not find a config that breaks. This can be rather frustrating to the user. The CONFIG_BISECT_CHECK option, when set to 1, will make sure that the bad config (with the minconfig applied) still fails before trying to bisect. And yes, I did get burned by this. Signed-off-by: Steven Rostedt <[email protected]>
2012-07-19ktest: Add PRE_INSTALL optionSteven Rostedt2-0/+16
Add the PRE_INSTALL option that will allow a user to specify a shell command to be executed before the install operation executes. Signed-off-by: Steven Rostedt <[email protected]>
2012-07-19ktest: Add PRE/POST_KTEST and TEST optionsSteven Rostedt2-0/+67
In order to let the user add commands before and after ktest runs, the PRE_KTEST and POST_KTEST options are defined. They hold shell commands that will execute befor ktest runs its first test, as well as when it completed its last test. The PRE_TEST and POST_TEST will be run befor and after (respectively) for a given test. They can either be global (done for all tests) or defined by a single test. Signed-off-by: Steven Rostedt <[email protected]>
2012-07-19ktest: Remove commented exitSteven Rostedt1-1/+0
A debug 'exit' was left in ktest.pl. Remove it. Signed-off-by: Steven Rostedt <[email protected]>
2012-07-18Merge branch 'linus' into perf/coreIngo Molnar3-17/+17
Pick up the latest ring-buffer fixes, before applying a new fix. Signed-off-by: Ingo Molnar <[email protected]>
2012-07-16Merge 3.5-rc7 into usb-nextGreg Kroah-Hartman1-5/+16
This resolves the merge issue with the drivers/usb/host/ehci-omap.c file. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-06Merge tag 'perf-core-for-mingo' of ↵Ingo Molnar17-314/+726
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core perf/core improvements and fixes: - Preparatory patches to use hw events in PMU syntax, from Jiri Olsa - Remaining backport of trace-cmd's libparseevent, from Namhyung Kim - Fix libtraceevent 'clean' make target, from Namhyung Kim - Teach ctags about libtraceevent error codes, from Namhyung Kim - Fix libtraceevent dependency files usage, from Namhyung Kim - Support hex number pretty printing in libtraceevent, fixing kvm output, from Namhyung Kim - Kill some die() usage in libtraceevent, from Namhyung Kim - Improve support for hw breakpoints parsing/pretty printing/testing, from Jiri Olsa - Clarify perf bench option naming, from Hitoshi Mitake - Look for ".note" ELF notes too, used in the kernel vdso, from Jiri Olsa - Fix internal PMU list usage, removing leak, from Robert Richter Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2012-07-05Merge branch 'perf/urgent' into perf/coreIngo Molnar1-3/+7
Merge this branch to pick up a fixlet and to update to a more recent base. Signed-off-by: Ingo Molnar <[email protected]>
2012-07-05Merge tag 'libtraceevent-core-for-acme' of ↵Arnaldo Carvalho de Melo2-122/+251
git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf into perf/core libtraceevent/core improvements * Remaining backport of trace-cmd's libparseevent Signed-off-by: Namhyung Kim <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-07-05perf tools: Split event symbols arrays to hw and sw partsJiri Olsa1-57/+117
It'll be convenient in upcoming patch to access hw event symbols strings via enum perf_hw_id indexes. In order not to duplicate the data, creating two separate arrays: event_symbols_hw for enum perf_hw_id events event_symbols_sw for enum perf_sw_ids events Changing the current event list code to follow the change. Signed-off-by: Jiri Olsa <[email protected]> Cc: Corey Ashford <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-07-05perf tools: Split out PE_VALUE_SYM parsing token to SW and HW tokensJiri Olsa2-5/+12
Spliting PE_VALUE_SYM token to PE_VALUE_SYM_HW and PE_VALUE_SYM_SW tokens to separate hardware and software symbols. This will be useful in upcomming patch where we want to be able to parse out only hardware events. Signed-off-by: Jiri Olsa <[email protected]> Cc: Corey Ashford <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-07-05perf tools: Add empty rule for new line in event syntax parsingJiri Olsa1-0/+1
The flex generator prints out each input character that is ignored by lex rules. Since the alias processing, we can have '\n' characters on input. We need to assign empty rule to it, so it's not printed out. Signed-off-by: Jiri Olsa <[email protected]> Cc: Corey Ashford <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-07-04perf test: Use ARRAY_SIZE in parse events testsJiri Olsa1-19/+10
Use ARRAY_SIZE instead of defining the sizes separately for each test arrays. Signed-off-by: Jiri Olsa <[email protected]> Cc: Corey Ashford <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-07-04tools lib traceevent: Cleanup realloc useNamhyung Kim2-22/+10
The if branch is completely unnecessary since 'realloc' can handle NULL pointers for the first parameter. This patch is just an adoption of Ulrich Drepper's recent patch on perf tools. Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ulrich Drepper <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Add missing break in make_bprint_argsPeter Huewe1-0/+1
In the current code we assign vsize=8 and then fall through to the default and assign vsize=1. -> probably the break is missing here, otherwise we can remove the case. Signed-off-by: Peter Huewe <[email protected]> Signed-off-by: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Check return value of arg_to_str()Namhyung Kim1-2/+13
The arg_to_str() can fail so we should handle that case properly. Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Check result of malloc() during reading tokenNamhyung Kim1-1/+1
The malloc can fail so the return value should be checked. For now, just use malloc_or_die(). Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Fix some commentsNamhyung Kim1-9/+7
Update and add missing argument descriptions and fix some typo on function comments. Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Do not call add_event() again if allocation failedNamhyung Kim1-1/+2
When memory allocation for the field name is failed, do not goto event_failed since we added the event already. Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Pass string type argument to argsNamhyung Kim1-0/+1
It seems PEVENT_FUNC_ARG_STRING missed passing the allocated string to the args array. Fix it. Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Handle realloc() failure pathNamhyung Kim1-16/+60
The realloc can fail so that we should handle it properly. Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Handle strdup failure casesNamhyung Kim1-2/+27
There were some places didn't check return value of the strdup and had unneeded/duplicated checks. Fix it. Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Introduce extend_token()Namhyung Kim1-26/+24
The __read_token() function has some duplicated code to handle internal buffer overflow. Factor them out to new extend_token(). According to the man pages of realloc/free(3), they can handle NULL pointer input so that it can be ended up to compact the code. Also handle error path correctly. Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Link: http://lkml.kernel.org/r/[email protected] [[email protected]: added some extra whitespace] Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Fix printk_cmp()Namhyung Kim1-4/+4
The printk_cmp function should use printk_map instead of func_map. Also rename the variables for consistency. Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Fix trace_printk for long integersWolfgang Mauerer1-2/+3
On 32 bit systems, a conversion of the trace_printk format string "%lu" -> "%llu" is intended (similar for %lx etc.) when a trace was taken on a machine with 64 bit long integers. However, the current code computes the bogus transformation "%lu" -> "%u". Fix this. Besides that, the transformation is only required on systems that don't use 64 bits for long integers natively. Signed-off-by: Wolfgang Mauerer <[email protected]> Signed-off-by: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Fix %pM print format arg handlingSteven Rostedt1-0/+1
When %pM is used, the arg value must be a 6 byte character that will be printed as a 6 byte MAC address. But the code does a break over the main code which updates the current processing arg to point to the next arg. If there are other print arguments after a %pM, they will be off by one. The next arg will still be processing the %pM arg. Reported-by: Johannes Berg <[email protected]> Signed-off-by: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Add support to show migrate disable counterSteven Rostedt1-19/+38
The RT kernel added a migrate disable counter in all events. Add support to show this in the latency format. Signed-off-by: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Add support for "%.*s" in bprintk eventsSteven Rostedt1-9/+25
The arg notation of '*' in bprintks is not handled by the parser. Implement it so that they show up properly in the output and do not kill the tracer from reporting events. Reported-by: Johannes Berg <[email protected]> Signed-off-by: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
2012-07-04tools lib traceevent: Let filtering numbers by string use function namesSteven Rostedt1-10/+35
As a pointer can be converted into a function name, let the filters work with the function name as well as with the pointer number. If the comparison expects a string, then convert numbers into functions, but only when the number is the same size as a long. Signed-off-by: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
2012-07-02mm: Fix signal SIGFPE in slabinfo.c.majianpeng1-7/+7
In function slab_stats(), if total_free is equal zero, it will error. So fix it. Acked-by: Christoph Lameter <[email protected]> Signed-off-by: majianpeng <[email protected]> Signed-off-by: Pekka Enberg <[email protected]>
2012-07-02perf bench: Fix confused variable namings and descriptions in mem subsystemHitoshi Mitake3-82/+82
As Namhyung Kim pointed, there are confused namings and descriptions of words "cycle" and "clock" in mem-memset.c and mem-memcpy.c. With the option "-c" (or "--clock", now renamed as "--cycle"), mem subsystem measures cost of memset() and memcpy() with cpu-cycles event. But current mem subsystem source code contains lots of confused variable namings and descriptions with "clock" (e.g. the variable use_clock). This is a very bad style because there is another software event named "cpu-clock". This patch replaces wrong usage of "clock" to "cycle". v2: modified Documentation/perf-bench.txt for the descriptions of --cycle option Signed-off-by: Hitoshi Mitake <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Namhyung Kim <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-07-02perf kvm: Fix segfault with report and mixed guestmount useDavid Ahern1-14/+15
Using the guestmount option on record: $ perf kvm --guest --host --guestmount=/tmp/guest-mount record -ag But not the subsequent report: $ perf kvm report causes a SEGFAULT in the usual place: (gdb) bt 0 0x0000000000470356 in machine__mmap_name (self=0x0, bf=0x7fffffffbdb0 " z\370\367\377\177", size= 4096) at util/map.c:712 1 0x00000000004453e8 in perf_event__process_kernel_mmap (tool=0x7fffffffde10, event=0x7ffff7f87e38, machine=0x0) at util/event.c:550 2 0x00000000004458c9 in perf_event__process_mmap (tool=0x7fffffffde10, event=0x7ffff7f87e38, sample= 0x7fffffffd2a0, machine=0x0) at util/event.c:656 3 0x00000000004733e0 in perf_session_deliver_event (session=0x91aca0, event=0x7ffff7f87e38, sample= 0x7fffffffd2a0, tool=0x7fffffffde10, file_offset=7736) at util/session.c:979 ... The MMAP events in this case already contain the full path to the module. No need to require it for the report path to. Signed-off-by: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-07-02perf kvm: Fix regression with guest machine creationDavid Ahern1-1/+1
Commit 743eb868657bdb1b26c7b24077ca21c67c82c777 reworked when the machines were created. Prior to this commit guest machines could be created in perf_event__process_kernel_mmap() while processing kernel MMAP events. This commit assumes that the machines exist by the time perf_session_deliver_event is called (e.g., during processing of build id events) - which is not always correct. One example is the use of default guest args (--guestkallsyms and --guestmodules) for short times where no samples hit within a guest module. For this case no build id is added to the file header. No build id == no machine created. That leads to the next example -- the use of no-buildid (-B) on the record for all perf-kvm invocations. In both cases perf report dies with a SEGFAULT of the form: (gdb) bt 0 0x000000000046dd7b in machine__mmap_name (self=0x0, bf=0x7fffffffbd20 "q\021", size=4096) at util/map.c:715 1 0x0000000000444161 in perf_event__process_kernel_mmap (tool=0x7fffffffdd80, event=0x7ffff7fb4120, machine=0x0) at util/event.c:562 2 0x0000000000444642 in perf_event__process_mmap (tool=0x7fffffffdd80, event=0x7ffff7fb4120, sample=0x7fffffffd210, machine=0x0) at util/event.c:668 3 0x0000000000470e0b in perf_session_deliver_event (session=0x915ca0, event=0x7ffff7fb4120, sample=0x7fffffffd210, tool=0x7fffffffdd80, file_offset=8480) at util/session.c:979 4 0x000000000047032e in flush_sample_queue (s=0x915ca0, tool=0x7fffffffdd80) at util/session.c:679 5 0x0000000000471c8d in __perf_session__process_events (session=0x915ca0, data_offset=400, data_size=150448, file_size=150848, tool= 0x7fffffffdd80) at util/session.c:1363 6 0x0000000000471d42 in perf_session__process_events (self=0x915ca0, tool=0x7fffffffdd80) at util/session.c:1379 7 0x000000000042484a in __cmd_report (rep=0x7fffffffdd80) at builtin-report.c:368 8 0x0000000000425bf1 in cmd_report (argc=0, argv=0x915b00, prefix=0x0) at builtin-report.c:756 9 0x0000000000438505 in __cmd_report (argc=4, argv=0x7fffffffe260) at builtin-kvm.c:84 10 0x000000000043882a in cmd_kvm (argc=4, argv=0x7fffffffe260, prefix=0x0) at builtin-kvm.c:131 11 0x00000000004152cd in run_builtin (p=0x7a54e8, argc=9, argv=0x7fffffffe260) at perf.c:273 12 0x00000000004154c7 in handle_internal_command (argc=9, argv=0x7fffffffe260) at perf.c:345 13 0x0000000000415613 in run_argv (argcp=0x7fffffffe14c, argv=0x7fffffffe140) at perf.c:389 14 0x0000000000415899 in main (argc=9, argv=0x7fffffffe260) at perf.c:487 Fix by allowing the machine to be created in perf_session_deliver_event. Tested with --guestmount option and default guest args, with and without -B arg on record for both and for short (10 seconds) and long (10 minutes) windows. Reported-by: Pradeep Kumar Surisetty <[email protected]> Signed-off-by: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Pradeep Kumar Surisetty <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-07-02perf script: Fix format regression due to libtraceevent mergeDavid Ahern1-2/+1
Consider the commands: perf record -e sched:sched_switch -fo /tmp/perf.data -a -- sleep 1 perf script -i /tmp/perf.data In v3.4 the output has the form (lines wrapped here) perf 29214 [005] 821043.582596: sched_switch: prev_comm=perf prev_pid=29214 prev_prio=120 prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120 In 3.5 that same line has become: perf 29214 [005] 821043.582596: sched_switch: <...>-29214 [005] 0.000000000: sched_switch: prev_comm=perf prev_pid=29214 prev_prio=120 prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120 Note the duplicates in the output -- pid, cpu, event name. With this patch the v3.4 output is restored: perf 29214 [005] 821043.582596: sched_switch: prev_comm=perf prev_pid=29214 prev_prio=120 prev_state=S ==> next_comm=swapper/5 next_pid=0 next_prio=120 v3: Remove that pesky newline too. Output now matches v3.4 (pre-libtracevent). v2: Change print_trace_event function local to perf per Steve's comments. Signed-off-by: David Ahern <[email protected]> Acked-by: Steven Rostedt <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-06-29perf tools: Adding round_up/round_down macrosJiri Olsa1-0/+10
Adding round_up and round_down macros. They will be used in upcoming patches. Signed-off-by: Jiri Olsa <[email protected]> Cc: Arun Sharma <[email protected]> Cc: Benjamin Redelings <[email protected]> Cc: Corey Ashford <[email protected]> Cc: Cyrill Gorcunov <[email protected]> Cc: Frank Ch. Eigler <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Robert Richter <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Tom Zanussi <[email protected]> Cc: Ulrich Drepper <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-06-29perf symbols: Add '.note' check into search for NOTE sectionJiri Olsa1-6/+23
Adding '.note' section name to be check when looking for notes section. The '.note' name is used by kernel VDSO. Signed-off-by: Jiri Olsa <[email protected]> Cc: Arun Sharma <[email protected]> Cc: Benjamin Redelings <[email protected]> Cc: Corey Ashford <[email protected]> Cc: Cyrill Gorcunov <[email protected]> Cc: Frank Ch. Eigler <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Robert Richter <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Tom Zanussi <[email protected]> Cc: Ulrich Drepper <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-06-29perf tools: Fix generation of pmu listRobert Richter1-1/+2
The internal pmu list was never used. With each perf_pmu__find() call the pmu structure was created new by parsing sysfs. Beside this it caused memory leaks. We now keep all pmus by adding them to the list. Also, pmu_lookup() should return pmus that do not expose the format specifier in sysfs. We need a valid internal pmu list in a later patch to iterate over all pmus that exist in the system. Signed-off-by: Robert Richter <[email protected]> Cc: Corey Ashford <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-06-29perf evsel: Handle hw breakpoints event names in perf_evsel__name()Jiri Olsa3-3/+41
Adding hw breakpoint events hook in the perf_evsel__name function, to display event names properly all over the perf tools. Updated hw breakpoints events tests. Signed-off-by: Jiri Olsa <[email protected]> Cc: Jovi Zhang <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-06-29perf tools: Fix hw breakpoint's type modifier parsingJiri Olsa3-4/+51
Fixing the hw breakpoint's type modifier parsing to allow all possible combinations of 'rwx' characters. Adding automated tests to the parsing test suite. Reported-by: Jovi Zhang <[email protected]> Original-patch-by: Namhyung Kim <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Cc: Jovi Zhang <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-06-29tools lib traceevent: Replace malloc_or_die to plain malloc in alloc_event()Namhyung Kim1-1/+3
Because the only caller of the alloc_event() (pevent_parse_event) checks return value properly, it can be changed to use plain malloc. Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-06-29tools lib traceevent: Add support for __print_hex()Namhyung Kim4-1/+89
Since the __print_hex() function is used in print fmt now, add corresponding parser routines. This makes the output of perf script on the kvm_emulate_insn event not to fail any more. before: kvm_emulate_insn: [FAILED TO PARSE] rip=3238197797 ... after: kvm_emulate_insn: 0:c102fa25:89 10 (prot32) Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-06-29tools lib traceevent: Use local variable 'field'Namhyung Kim1-8/+11
Use local variable 'field' to reduce typing. It is needed by later patch not to exceed 80 column. Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2012-06-29tools lib traceevent: Check string is really printableNamhyung Kim1-1/+13
When libtraceevent parses format fields, it assumes that array of 1 byte is string but it's not always true. The kvm_emulate_insn contains 15 u8 array of insn that contains (binary) instructions. Thus when it's printed, it'll have broken output like below: kvm_emulate_insn: [FAILED TO PARSE] rip=3238197797 csbase=0 len=2 \ insn=<89>P^]<B4>& flags=5 failed=0 With this patch: kvm_emulate_insn: [FAILED TO PARSE] rip=3238197797 csbase=0 len=2 \ insn=ARRAY[89, 10, 5d, c3, 8d, b4, 26, 00, 00, 00, 00, 55, 89, e5, 3e] flags=5 failed=0 Suggested-by: Steven Rostedt <[email protected]> Signed-off-by: Namhyung Kim <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>