aboutsummaryrefslogtreecommitdiffstats
path: root/tools (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-01-31perf gtk/browser: Add support for event group viewNamhyung Kim1-4/+52
Show group members's overhead also when showing leader's if event group is enabled. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranina@google.com> Link: http://lkml.kernel.org/r/1358845787-1350-13-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf hists browser: Add suppport for event group viewNamhyung Kim1-0/+57
Show group members' overhead also when showing the leader's if event group is enabled. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1358845787-1350-12-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf hists browser: Move coloring logic to hpp functionsNamhyung Kim1-30/+42
Move coloring logic into the hpp functions so that each value can be colored independently. It'd required for event group view. For overhead column, add a callback for printing 'folded_sign' of callchains of a hist entry. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1358845787-1350-11-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf ui/hist: Add support for event group viewNamhyung Kim2-1/+63
Show group member's overhead also when showing the leader's if event group is enabled. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1358845787-1350-10-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf gtk/browser: Convert hpp helpers to a functionNamhyung Kim1-21/+47
The hpp helpers do same job for each field so it was implemented as macro in order to access those fields easily. But it gets cumbersome to maintain a large function in a macro as the function grows. Factor it out to a function with a little helper macro to access field. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1358845787-1350-9-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf hists browser: Convert hpp helpers to a functionNamhyung Kim1-14/+32
The hpp helpers do same job for each field so it was implemented as macro in order to access those fields easily. But it gets cumbersome to maintain a large function in a macro as the function grows. Factor it out to a function with a little helper macro to access field. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1358845787-1350-8-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf ui/hist: Consolidate hpp helpersNamhyung Kim1-154/+84
Most of hpp helper functions do same jobs for different fields thus consolidate them to appropriate functions/macros. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1358845787-1350-7-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf hists: Resort hist entries using group members for outputNamhyung Kim2-1/+60
When event group is enabled, sorting hist entries on periods for output should consider groups members' period also. To do that, build period table using link/pair information and compare the table. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1358845787-1350-6-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf report: Make another loop for linking group histsNamhyung Kim2-2/+14
Now the event grouping viewing requires linking all member hists in a group to the leader's. Thus hists__output_resort should be called after linking all events in evlist. Introduce symbol_conf.event_group flag to determine whether the feature is enabled or not. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1358845787-1350-5-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf header: Add HEADER_GROUP_DESC featureNamhyung Kim3-0/+169
Save group relationship information so that it can be restored when perf report is running. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1358845787-1350-4-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf tests: Add group test conditionsNamhyung Kim1-0/+28
As some new fields for handling groups added, check them to be sure to have valid values in test__group* cases. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1358845787-1350-3-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf tools: Keep group informationNamhyung Kim6-1/+25
Add a few of group-related field in struct perf_{evlist,evsel} so that the group information in a evlist can be known easily. It only counts groups which have more than 1 members since leader-only groups are treated as non-group events. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1358845787-1350-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf top: Delete maps on exitArnaldo Carvalho de Melo1-2/+4
Removing one more memory leak found with valgrind. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-gnb1gms0k8wictmtm2umpr8u@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31perf top: Stop using exit()Arnaldo Carvalho de Melo1-23/+33
Just return to the perf main() routine so that an unified exit path can be followed and resources released, helping in finding memory leaks. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-ro8oeodo96490nrhcph57atr@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-31ktest: Add make_warnings_file and process full warningsSteven Rostedt (Red Hat)3-6/+185
Although the patchcheck test checks for warnings in the files that were changed, this check does not catch warnings that were caused by header file changes and the warnings appear in C files not touched by the commit. Add a new option called WARNINGS_FILE. If this option is set, then the file it points to is read before bulid, and the file should contain a list of known warnings. If a warning appears in the build, this file is checked, and if the warning does not exist in this file, then it fails the build showing the new warning. If the WARNINGS_FILE points to a file that does not exist, this will cause any warning in the build to fail. A new test is also added called "make_warnings_file". This test will create do a build and record any warnings it finds into the WARNINGS_FILE. This test is something that can be run before other tests to build a warnings file of "known warnings", ie, warnings that were there before your changes. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-01-31ktest: Allow a test option to use its default optionSteven Rostedt (Red Hat)1-6/+10
Options are allowed to use other options, for example: LOG_FILE = ${OUTPUT_DIR}/${MACHINE}.log where the option LOG_FILE used the options OUTPUT_DIR and MACHINE. But if a test option were to use a default option, it will not get substituted: OUTPUT_DIR = ${THIS_DIR}/${MACHINE} TEST_START OUTPUT_DIR = ${OUTPUT_DIR}/t1 For the above test, OUTPUT_DIR will stay literally "${OUTPUT_DIR}/t1" and not be converted to "${THIS_DIR}/${MACHINE}/t1". When the test runs, it will pass the ${OUTPUT_DIR} to the shell, which would probaly interpret it as "", and the output directory will end up as "/t1". Change the code where if a test option has its own option name in its defined field, and a default option exists, then substitute the default option in its place. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-01-30ktest: Strip off '\n' when reading which files were modifiedSteven Rostedt (Red Hat)1-0/+4
The patchcheck test looks at what files are modified for each patch it checks and makes sure that those files do not produce any warnings. Unfortunately, when it read the diffstat, the newlines were added on the files and this made compares miss warnings, and commits that should not have passed, ktest let pass. Fix this by using the perl command "chomp" that strips off whitespace at the end of lines. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-01-30ktest: Do not require CONSOLE for build or install bisectsSteven Rostedt (Red Hat)1-5/+22
If the user is doing a build or install bisect, there's no reason to have them define CONSOLE, as the console does not need to be read. The console only needs to be read for boot tests. CONSOLE is not required for normal build or install tests, let's not require it for bisect tests with BISECT_TYPE of build or install. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2013-01-30perf header: Fix double fclose() on do_write(fd, xxx) failureThomas Jarosch1-1/+3
cppcheck reported: [util/header.c:983]: (error) Used file that is not opened. Thanks to Arnaldo Carvalho de Melo for pointing out that fclose(NULL) is undefined behavior -> protect against it. Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Link: http://lkml.kernel.org/r/1751778.SZQB4fNdIh@storm Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-30perf header: Fix memory leak for the "Not caching a kptr_restrict'ed /proc/kallsyms" caseThomas Jarosch1-1/+2
cppcheck reported: [util/header.c:316]: (error) Memory leak: filename [util/header.c:316]: (error) Memory leak: linkname Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Link: http://lkml.kernel.org/r/9377388.0eFDp53iW6@storm Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-30perf tools: Fix memory leak on errorThomas Jarosch1-1/+3
cppcheck reported: [util/event.c:480]: (error) Memory leak: event Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Link: http://lkml.kernel.org/r/2717013.8dV0naNhAV@storm Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-30perf sort: Use pclose() instead of fclose() on pipe streamThomas Jarosch1-2/+5
cppcheck message: [tools/perf/util/sort.c:277]: (error) Mismatching allocation and deallocation: fp Also fix descriptor leak on error and always initialize the "fp" variable. Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Link: http://lkml.kernel.org/r/1359112354.yZcisNZ4k0@storm Link: http://lkml.kernel.org/r/2266358.qvDXKLvJ67@storm Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-30perf tools: Fix possible double free on errorThomas Jarosch1-0/+1
Can only be triggered via CROSS_COMPILE env var. Detected by cppcheck. Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com> Link: http://lkml.kernel.org/r/36736865.AIlztKhDqN@storm Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-30perf tools, powerpc: Fix compile warnings in tests/attr.cSukadev Bhattiprolu1-0/+5
We print several '__u64' quantities using '%llu'. On powerpc, we by default include '<asm-generic/int-l64.h> which results in __u64 being an unsigned long. This causes compile warnings which are treated as errors due to '-Werror'. By defining __SANE_USERSPACE_TYPES__ we include <asm-generic/int-ll64.h> and define __u64 as unsigned long long. Changelog[v2]: [Michael Ellerman] Use __SANE_USERSPACE_TYPES__ and avoid PRIu64 format specifier - which as Jiri Olsa pointed out, breaks on x86-64. Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Cc: Anton Blanchard <anton@au1.ibm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Michael Ellerman <ellerman@au1.ibm.com> Cc: linuxppc-dev@ozlabs.org Link: http://lkml.kernel.org/r/20130124054439.GA31588@us.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-30perf evsel: Fix memory leaks on evsel->countsNamhyung Kim4-0/+8
The ->counts field was never freed in the current code. Add perf_evsel__free_counts() function to free it properly. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1359078284-32080-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-30perf stat: Add interval printingStephane Eranian2-15/+146
This patch adds a new printing mode for perf stat. It allows interval printing. That means perf stat can now print event deltas at regular time interval. This is useful to detect phases in programs. The -I option enables interval printing. It expects an interval duration in milliseconds. Minimum is 100ms. Once, activated perf stat prints events deltas since last printout. All modes are supported. $ perf stat -I 1000 -e cycles noploop 10 noploop for 10 seconds # time counts events 1.000109853 2,388,560,546 cycles 2.000262846 2,393,332,358 cycles 3.000354131 2,393,176,537 cycles 4.000439503 2,393,203,790 cycles 5.000527075 2,393,167,675 cycles 6.000609052 2,393,203,670 cycles 7.000691082 2,393,175,678 cycles The output format makes it easy to feed into a plotting program such as gnuplot when the -I option is used in combination with the -x option: $ perf stat -x, -I 1000 -e cycles noploop 10 noploop for 10 seconds 1.000084113,2378775498,cycles 2.000245798,2391056897,cycles 3.000354445,2392089414,cycles 4.000459115,2390936603,cycles 5.000565341,2392108173,cycles Signed-off-by: Stephane Eranian <eranian@google.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1359460064-3060-3-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-30perf evsel: Add prev_raw_count fieldStephane Eranian2-0/+27
This field will be used by commands which print counter deltas on regular timer intervals, such as perf stat -I. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1359460064-3060-2-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-30perf tools: Make numa benchmark optionalPeter Hurley3-2/+29
Commit "perf: Add 'perf bench numa mem'..." added a NUMA performance benchmark to perf. Make this optional and test for required dependencies. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Acked-by: Ingo Molnar <mingo@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1359337882-21821-1-git-send-email-peter@hurleysoftware.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-30perf: Add 'perf bench numa mem' NUMA performance measurement suiteIngo Molnar4-1/+1747
Add a suite of NUMA performance benchmarks. The goal was simulate the behavior and access patterns of real NUMA workloads, via a wide range of parameters, so this tool goes well beyond simple bzero() measurements that most NUMA micro-benchmarks use: - It processes the data and creates a chain of data dependencies, like a real workload would. Neither the compiler, nor the kernel (via KSM and other optimizations) nor the CPU can eliminate parts of the workload. - It randomizes the initial state and also randomizes the target addresses of the processing - it's not a simple forward scan of addresses. - It provides flexible options to set process, thread and memory relationship information: -G sets "global" memory shared between all test processes, -P sets "process" memory shared by all threads of a process and -T sets "thread" private memory. - There's a NUMA convergence monitoring and convergence latency measurement option via -c and -m. - Micro-sleeps and synchronization can be injected to provoke lock contention and scheduling, via the -u and -S options. This simulates IO and contention. - The -x option instructs the workload to 'perturb' itself artificially every N seconds, by moving to the first and last CPU of the system periodically. This way the stability of convergence equilibrium and the number of steps taken for the scheduler to reach equilibrium again can be measured. - The amount of work can be specified via the -l loop count, and/or via a -s seconds-timeout value. - CPU and node memory binding options, to test hard binding scenarios. THP can be turned on and off via madvise() calls. - Live reporting of convergence progress in an 'at glance' output format. Printing of convergence and deconvergence events. The 'perf bench numa mem -a' option will start an array of about 30 individual tests that will each output such measurements: # Running 5x5-bw-thread, "perf bench numa mem -p 5 -t 5 -P 512 -s 20 -zZ0q --thp 1" 5x5-bw-thread, 20.276, secs, runtime-max/thread 5x5-bw-thread, 20.004, secs, runtime-min/thread 5x5-bw-thread, 20.155, secs, runtime-avg/thread 5x5-bw-thread, 0.671, %, spread-runtime/thread 5x5-bw-thread, 21.153, GB, data/thread 5x5-bw-thread, 528.818, GB, data-total 5x5-bw-thread, 0.959, nsecs, runtime/byte/thread 5x5-bw-thread, 1.043, GB/sec, thread-speed 5x5-bw-thread, 26.081, GB/sec, total-speed See the help text and the code for more details. Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-01-30tools: Correct typo in tools MakefileBorislav Petkov1-1/+1
It should be make -C tools/ <tool>_install Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1359456492-22156-1-git-send-email-bp@alien8.de Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-30perf tests: Fix leaks on PERF_RECORD_* testArnaldo Carvalho de Melo1-5/+7
This test: 7: Validate PERF_RECORD_* events & perf_sample fields needs to call perf_evlist__delete_maps(). Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-t3181qy15avffdacqjcxfku2@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-25Merge 3.8-rc5 into driver-core-nextGreg Kroah-Hartman2-1/+11
This resolves a gpio driver merge issue pointed out in linux-next. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-25Merge 3.8-rc5 into usb-nextGreg Kroah-Hartman2-1/+11
This fixes up a conflict with drivers/usb/serial/io_ti.c that came up in linux-next. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-25Merge 3.8-rc5 into char-misc-nextGreg Kroah-Hartman2-1/+11
This pulls in all of the 3.8-rc5 fixes into this branch so we can test easier. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-25perf tests: Call machine__exit in the vmlinux matches kallsyms testArnaldo Carvalho de Melo1-1/+3
Removing leaks with valgrind. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-x9hja7wxwexe8ca9v2j8qtlg@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-25perf ui browser: Free browser->helpline() on ui_browser__hide()Arnaldo Carvalho de Melo1-0/+2
It is allocated at ui_browser__show(), so free it in its counterpart, ui_browser__hide(). Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-g449kvnbcpli4ceyxbe2jp1e@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-25perf header: Stop using die() calls when processing tracing dataArnaldo Carvalho de Melo1-6/+12
The callers of this function (perf_event__process_tracing_data) already handles a negative value return as error, so just use pr_err() to log the problem and return -1 instead of panic'ing. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-eeeljnecpi0zi5s7ux1mzdv9@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-25perf kmem: Use memdup()Arnaldo Carvalho de Melo1-3/+3
Instead of hand coded equivalent. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-42ldngi973f4ssvzlklo8t2k@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-25perf tools: Use memdup in map__cloneArnaldo Carvalho de Melo1-6/+2
We have memdup() exactly for that, remove open coded dup. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-tnsoexrgv6u9l125srq2c7su@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-25perf tools: Stop using 'self' in map.[ch]Arnaldo Carvalho de Melo2-72/+70
As suggested by tglx, 'self' should be replaced by something that is more useful. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-vse2c54m0yahx6p79tmoel03@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-25perf tools: Stop using 'self' in strlistArnaldo Carvalho de Melo2-48/+48
As suggested by tglx, 'self' should be replaced by something that is more useful. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-933537sxtcz47qs0e0ledmrp@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-25tools lib traceevent: Handle dynamic array's element size properlyJiri Olsa1-2/+37
Fixing the dynamic array format field parsing. Currently the event_read_fields function could segfault while parsing dynamic array other than string type. The reason is the event->pevent does not need to be set and gets dereferenced unconditionaly. Also adding proper initialization of field->elementsize based on the parsed dynamic type. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1359060403-32422-1-git-send-email-jolsa@redhat.com [ committer note: Made a char pointer parameter const, as requested by Steven ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-24perf test: Allow skipping testsArnaldo Carvalho de Melo2-2/+19
Sometimes a test is problematic for some reason and one wants to skip it, for instance: [root@sandy ~]# perf test 1: vmlinux symtab matches kallsyms : Ok 2: detect open syscall event : Ok 3: detect open syscall event on all cpus : Ok 4: read samples using the mmap interface : Ok 5: parse events tests : Warning: bad op token { Warning: bad op token { Warning: bad op token { Warning: bad op token { Warning: bad op token { Warning: function is_writable_pte not defined Segmentation fault (core dumped) So now we can use -s/--skip while the problematic tests are being fixed, allowing us to test all the other entries: [root@sandy ~]# perf test -s 5 1: vmlinux symtab matches kallsyms : Ok 2: detect open syscall event : Ok 3: detect open syscall event on all cpus : Ok 4: read samples using the mmap interface : Ok 5: parse events tests : Skip (user override) 6: x86 rdpmc test : Ok 7: Validate PERF_RECORD_* events & perf_sample fields : Ok 8: Test perf pmu format parsing : Ok 9: Test dso data interface : Ok 10: roundtrip evsel->name check : Ok 11: Check parsing of sched tracepoints fields : Ok 12: Generate and check syscalls:sys_enter_open event fields: Ok 13: struct perf_event_attr setup : Ok 14: Test matching and linking mutliple hists : Ok 15: Try 'use perf' in python, checking link problems : Ok [root@sandy ~]# Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-klzd8p57jzdryafqkmlppcb1@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-24perf tools: Allow passing a list to intlist__newArnaldo Carvalho de Melo3-3/+28
Just like strlist allows passing a list of entries to parse. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-em50vqvvmlnc6k9tw4xtixus@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-24perf tools: Allow passing NULL to intlist__findArnaldo Carvalho de Melo1-2/+7
So that we can work with optional parameters that may not set up an intlist. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-e9tmvgdzehqrza11zs0nbg7g@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-24perf script: Remove workqueue-stats scriptTom Zanussi4-136/+0
The tracepoints used by the workqueue-stats script no longer exist so trying to run the script results in: # perf script record workqueue-stats invalid or unsupported event: 'workqueue:workqueue_creation' Run 'perf list' for a list of valid events So remove the script until it can be reworked using the new workqueue tracepoints. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Link: http://lkml.kernel.org/r/e7a7637d5df9df86887c3bff7683574665ec5360.1358527965.git.tom.zanussi@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-24perf script: hook up perf_scripting_context->peventTom Zanussi2-0/+2
Running the check-perf-trace scripts causes segfaults in both the Perl and Python cases: # perf script record check-perf-trace # perf script -s libexec/perf-core/scripts/python/check-perf-trace.py trace_begin Segmentation fault (core dumped) The reason is that the 'pevent' field was added to perf_scripting_context but it wasn't hooked up with an actual pevent in either case, so when one of the 'common' fields is accessed (in util/trace-event-parse.c:get_common_fields()), pevent->events tries to dereference a NULL pointer. This sets the pevent field when the scripting context is set up. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Link: http://lkml.kernel.org/r/d2b1b8166a6ca0a36e1f5255b88a8289058ba236.1358527965.git.tom.zanussi@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-24perf script: Don't display trace info when invoking scriptsTom Zanussi1-1/+2
Only display the trace info if using the default event display. When invoking scripts we assume they have complete control of what's displayed so we shouldn't unconditionally display the trace info, and when generating scripts we don't expect to see trace info obscuring the output message. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Link: http://lkml.kernel.org/r/12ec084ef2870178915c907d16cd1dfa19fbb39e.1358527965.git.tom.zanussi@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-24perf tools: Reinstate 'signed' field flag for tracepointsTom Zanussi1-1/+2
For some reason the libtraceevent tracepoint-parsing code is missing the FIELD_IS_SIGNED flag-setting code, which causes problems for the Perl trace event binding at least, since it ends up unable to recognize negative numbers. Things like checking for negative return values therefore fail, causing scripts like rwtop to instead interpret the negative return value as a large positive value, which in turn get added to e.g. read totals with insanely invalid results. So set the FIELD_IS_SIGNED flag for tracepoint events that specify "signed:1". Before: # perf script record rw-by-pid # perf script report rw-by-pid read counts by pid: pid comm # reads bytes_requested bytes_read ------ -------------------- ----------- ---------- ---------- 753 Xorg 88 512000 7.74763251095801e+20 1619 firefox 42 462 2.58254417031934e+20 1232 gnome-shell 11 176 1.10680464442257e+20 1471 gnome-terminal 3 16366 18446744073709551615 1408 libsocialweb-co 2 32 18446744073709551613 After: # perf script report rw-by-pid read counts by pid: pid comm # reads bytes_requested bytes_read ------ -------------------- ----------- ---------- ---------- 753 Xorg 88 512000 2764 1619 firefox 42 462 126 1232 gnome-shell 11 176 40 1471 gnome-terminal 3 16366 10 1408 libsocialweb-co 2 32 8 Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Link: http://lkml.kernel.org/r/1471b5968821a455cf5168bb4567964e74ecf530.1358527965.git.tom.zanussi@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-01-24perf tools: Remove some needless die() calls from the main routineArnaldo Carvalho de Melo1-11/+21
Some would just call exit() anyway right after calling die() and the main routine doesn't have to call it, just return the exit value. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-nzq0sdur6oq6lgkt2ipf4o8s@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>