summaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/bin/export-to-sqlite-report
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-08-17 09:41:56 +0200
committerIngo Molnar <mingo@kernel.org>2017-08-17 09:41:56 +0200
commit9881223c6cc0644cc3aeea41e1f19ea7e3041f33 (patch)
tree9cbf5e56de05d64fbb39aec49b00a616568ecb92 /tools/perf/scripts/python/bin/export-to-sqlite-report
parent927d2c21f2e82b93c791799c8da932a9bdffb436 (diff)
parent35435cd06081d7db96bc617b65ba556f8e24340e (diff)
downloadlinux-9881223c6cc0644cc3aeea41e1f19ea7e3041f33.tar.bz2
Merge tag 'perf-core-for-mingo-4.14-20170816' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf core improvements and fixes: New features: - Support exporting Intel PT data to sqlite3 with python perf scripts, this is in addition to the postgresql support that was already there (Adrian Hunter) Infrastructure changes: - Handle perf tool builds with less features in perf shell tests, such as those with NO_LIBDWARF=1 or even without 'perf probe' (Arnaldo Carvalho de Melo) - Replace '|&' with '2>&1 |' to work with more shells in the just introduced perf test shell harness (Kim Phillips) Architecture related fixes: - Fix endianness problem when loading parameters in the BPF prologue generated by perf, noticed using 'perf test BPF' in s390x systems (Wang Nan, Thomas Richter) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/export-to-sqlite-report')
-rw-r--r--tools/perf/scripts/python/bin/export-to-sqlite-report29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/perf/scripts/python/bin/export-to-sqlite-report b/tools/perf/scripts/python/bin/export-to-sqlite-report
new file mode 100644
index 000000000000..5ff6033e70ba
--- /dev/null
+++ b/tools/perf/scripts/python/bin/export-to-sqlite-report
@@ -0,0 +1,29 @@
+#!/bin/bash
+# description: export perf data to a sqlite3 database
+# args: [database name] [columns] [calls]
+n_args=0
+for i in "$@"
+do
+ if expr match "$i" "-" > /dev/null ; then
+ break
+ fi
+ n_args=$(( $n_args + 1 ))
+done
+if [ "$n_args" -gt 3 ] ; then
+ echo "usage: export-to-sqlite-report [database name] [columns] [calls]"
+ exit
+fi
+if [ "$n_args" -gt 2 ] ; then
+ dbname=$1
+ columns=$2
+ calls=$3
+ shift 3
+elif [ "$n_args" -gt 1 ] ; then
+ dbname=$1
+ columns=$2
+ shift 2
+elif [ "$n_args" -gt 0 ] ; then
+ dbname=$1
+ shift
+fi
+perf script $@ -s "$PERF_EXEC_PATH"/scripts/python/export-to-sqlite.py $dbname $columns $calls