Lines Matching +full:in +full:- +full:functions

1 perf-script-perl(1)
5 ----
6 perf-script-perl - Process trace data with a Perl script
9 --------
11 'perf script' [-s [Perl]:script[.pl] ]
14 -----------
17 built-in Perl interpreter. It reads and processes the input file and
18 displays the results of the trace analysis implemented in the given
22 ---------------
25 -g perl' in the same directory as an existing perf.data trace file.
27 the event types in the trace file; it simply prints every available
28 field for each event in the trace file.
30 You can also look at the existing scripts in
31 ~/libexec/perf-core/scripts/perl for typical examples showing how to
33 the check-perf-script.pl script, while not interesting for its results,
37 --------------
39 When perf script is invoked using a trace script, a user-defined
40 'handler function' is called for each event in the trace. If there's
46 handler function; some of the less common ones aren't - those are
50 all sched_wakeup events in the system:
52 # perf record -a -e sched:sched_wakeup
55 the above option: -a to enable system-wide collection.
60 ----
72 ----
76 ----
83 ----
87 The $common_* arguments in the handler's argument list are the set of
89 to the common_* fields in the format file, but some are synthesized,
91 to every event as arguments but are available as library functions.
96 $context an opaque 'cookie' used in calls back into perf
103 All of the remaining fields in the event's format file have
105 seen in the example above.
108 every event in a trace, which covers 90% of what you need to know to
112 -------------
118 ----
119 use lib "$ENV{'PERF_EXEC_PATH'}/scripts/perl/Perf-Trace-Util/lib";
120 use lib "./Perf-Trace-Util/lib";
124 ----
126 The rest of the script can contain handler functions and support
127 functions in any order.
129 Aside from the event handler functions discussed above, every script
130 can implement a set of optional functions:
135 ----
139 ----
142 processed and gives scripts a chance to do end-of-script tasks, such
145 ----
149 ----
155 ----
161 ----
164 built-in perf script Perl modules and their associated functions.
166 AVAILABLE MODULES AND FUNCTIONS
167 -------------------------------
169 The following sections describe the functions and variables available
170 via the various Perf::Trace::* Perl modules. To use the functions and
177 These functions provide some essential functions to user scripts.
179 The *flag_str* and *symbol_str* functions provide human-readable
184 …flag_str($event_name, $field_name, $field_value) - returns the string representation corresponding…
185 …symbol_str($event_name, $field_name, $field_value) - returns the string representation correspondi…
190 Some of the 'common' fields in the event format file aren't all that
193 Perf::Trace::Context defines a set of functions that can be used to
194 access this data in the context of the current event. Each of these
195 functions expects a $context variable, which is the same as the
199 common_pc($context) - returns common_preempt count for the current event
200 common_flags($context) - returns common_flags for the current event
201 common_lock_depth($context) - returns common_lock_depth for the current event
206 Various utility functions for use with perf script:
208 nsecs($secs, $nsecs) - returns total nsecs given secs/nsecs pair
209 nsecs_secs($nsecs) - returns whole secs portion given nsecs
210 nsecs_nsecs($nsecs) - returns nsecs remainder given nsecs
211 nsecs_str($nsecs) - returns printable string in the form secs.nsecs
212 avg($total, $n) - returns average given a sum and a total number of values
215 --------
216 linkperf:perf-script[1]