[lkml]   [2019]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 17/85] perf db-export: Add brief documentation
From: Adrian Hunter <>

Add brief documentation to explain how the database export maintains
backward and forward compatibility.

Signed-off-by: Adrian Hunter <>
Cc: Jiri Olsa <>
Signed-off-by: Arnaldo Carvalho de Melo <>
tools/perf/Documentation/db-export.txt | 41 ++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100644 tools/perf/Documentation/db-export.txt

diff --git a/tools/perf/Documentation/db-export.txt b/tools/perf/Documentation/db-export.txt
new file mode 100644
index 000000000000..52ffccb02d55
--- /dev/null
+++ b/tools/perf/Documentation/db-export.txt
@@ -0,0 +1,41 @@
+Database Export
+perf tool's python scripting engine:
+ tools/perf/util/scripting-engines/trace-event-python.c
+supports scripts:
+ tools/perf/scripts/python/
+ tools/perf/scripts/python/
+which export data to a SQLite3 or PostgreSQL database.
+The export process provides records with unique sequential ids which allows the
+data to be imported directly to a database and provides the relationships
+between tables.
+Over time it is possible to continue to expand the export while maintaining
+backward and forward compatibility, by following some simple rules:
+1. Because of the nature of SQL, existing tables and columns can continue to be
+used so long as the names and meanings (and to some extent data types) remain
+the same.
+2. New tables and columns can be added, without affecting existing SQL queries,
+so long as the new names are unique.
+3. Scripts that use a database (e.g. can maintain
+backward compatibility by testing for the presence of new tables and columns
+before using them. e.g. function IsSelectable() in
+4. The export scripts themselves maintain forward compatibility (i.e. an existing
+script will continue to work with new versions of perf) by accepting a variable
+number of arguments (e.g. def call_return_table(*x)) i.e. perf can pass more
+arguments which old scripts will ignore.
+5. The scripting engine tests for the existence of script handler functions
+before calling them. The scripting engine can also test for the support of new
+or optional features by checking for the existence and value of script global
 \ /
  Last update: 2019-06-11 21:15    [W:0.238 / U:3.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site