diff options
author | tor-jeremiassen <tor@ti.com> | 2016-02-17 10:58:21 -0600 |
---|---|---|
committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2016-06-20 11:16:06 -0600 |
commit | 69f28417978e8d4a35c36275340170aa31458e09 (patch) | |
tree | c0863bc5d488cc6fdaadd14d4d0a4f104b24ba8c /tools/perf/scripts/python/cs-trace-ranges.py | |
parent | 1265cc36fba27539b82603a6950488ee1c8da70e (diff) |
perf scripts: Add python scripts for CoreSight traces
Example scripts for CoreSight trace processing with perf script.
Signed-off-by: Tor Jeremiassen <tor@ti.com>
Diffstat (limited to 'tools/perf/scripts/python/cs-trace-ranges.py')
-rw-r--r-- | tools/perf/scripts/python/cs-trace-ranges.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/perf/scripts/python/cs-trace-ranges.py b/tools/perf/scripts/python/cs-trace-ranges.py new file mode 100644 index 000000000000..c8edacba0f83 --- /dev/null +++ b/tools/perf/scripts/python/cs-trace-ranges.py @@ -0,0 +1,44 @@ +# +# Copyright(C) 2016 Linaro Limited. All rights reserved. +# Author: Tor Jeremiassen <tor.jeremiassen@linaro.org> +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published by +# the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program. If not, see <http://www.gnu.org/licenses/>. +# + +import os +import sys + +sys.path.append(os.environ['PERF_EXEC_PATH'] + \ + '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') + +from perf_trace_context import * + +def trace_begin(): + pass; + +def trace_end(): + pass + +def process_event(t): + + sample = t['sample'] + + print "range:",format(sample['ip'],"x"),"-",format(sample['addr'],"x") + +def trace_unhandled(event_name, context, event_fields_dict): + print ' '.join(['%s=%s'%(k,str(v))for k,v in sorted(event_fields_dict.items())]) + +def print_header(event_name, cpu, secs, nsecs, pid, comm): + print "print_header" + print "%-20s %5u %05u.%09u %8u %-20s " % \ + (event_name, cpu, secs, nsecs, pid, comm), |