aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/bin/export-to-sqlite-report
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2017-08-03 04:31:28 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-08-15 15:37:55 -0400
commit564b9527d1ccf5d581275391e39ac4b1f29f0d08 (patch)
treea1d68cec82a7ab114e8dca3a097f1b2ba2ac7cae /tools/perf/scripts/python/bin/export-to-sqlite-report
parent2295e9f850b0efbc57c81fccdd8bd8d26fe10029 (diff)
perf script python: Add support for exporting to sqlite3
Add support for exporting to SQLite 3 the same data as the PostgreSQL export. Committer note: Tested on RHEL 7.4 using the 1.2.2-4el python-pyside packages from EPEL. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Link: http://lkml.kernel.org/r/1501749090-20357-4-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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 @@
1#!/bin/bash
2# description: export perf data to a sqlite3 database
3# args: [database name] [columns] [calls]
4n_args=0
5for i in "$@"
6do
7 if expr match "$i" "-" > /dev/null ; then
8 break
9 fi
10 n_args=$(( $n_args + 1 ))
11done
12if [ "$n_args" -gt 3 ] ; then
13 echo "usage: export-to-sqlite-report [database name] [columns] [calls]"
14 exit
15fi
16if [ "$n_args" -gt 2 ] ; then
17 dbname=$1
18 columns=$2
19 calls=$3
20 shift 3
21elif [ "$n_args" -gt 1 ] ; then
22 dbname=$1
23 columns=$2
24 shift 2
25elif [ "$n_args" -gt 0 ] ; then
26 dbname=$1
27 shift
28fi
29perf script $@ -s "$PERF_EXEC_PATH"/scripts/python/export-to-sqlite.py $dbname $columns $calls