File: otf2_high_level_reader_example.py

package info (click to toggle)
otf2 3.1.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,000 kB
  • sloc: ansic: 92,997; python: 16,977; cpp: 9,057; sh: 6,299; makefile: 238; awk: 54
file content (21 lines) | stat: -rw-r--r-- 676 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python
#
# This file is part of the Score-P software (http://www.score-p.org)
#
# Copyright (c) 2015-2017,
# Technische Universitaet Dresden, Germany
#
# This software may be modified and distributed under the terms of
# a BSD-style license.  See the COPYING file in the package base
# directory for details.
#

import otf2


with otf2.reader.open('TestArchive/traces.otf2') as trace:
    print("Read {} string definitions".format(len(trace.definitions.strings)))

    for location, event in trace.events:
        print("Encountered {} event {} on {}".format(type(event).__name__,
                                                              event, location))