Lines Matching refs:the
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
24 You can avoid reading the rest of this document by running 'perf script
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
33 the check-perf-script.pl script, while not interesting for its results,
34 attempts to exercise all of the main scripting features.
40 'handler function' is called for each event in the trace. If there's
41 no handler function defined for a given event type, the event is
42 ignored (or passed to a 'trace_handled' function, see below) and the
45 Most of the event's field values are passed as arguments to the
46 handler function; some of the less common ones aren't - those are
47 available as calls back into the perf executable (see below).
49 As an example, the following perf record command can be used to record
50 all sched_wakeup events in the system:
55 the above option: -a to enable system-wide collection.
57 The format file for the sched_wakep event defines the following fields
85 The handler function takes the form subsystem::event_name.
87 The $common_* arguments in the handler's argument list are the set of
88 arguments passed to all event handlers; some of the fields correspond
89 to the common_* fields in the format file, but some are synthesized,
90 and some of the common_* fields aren't common enough to to be passed
93 Here's a brief description of each of the invariant event args:
95 $event_name the name of the event as text
97 $common_cpu the cpu the event occurred on
98 $common_secs the secs portion of the event timestamp
99 $common_nsecs the nsecs portion of the event timestamp
100 $common_pid the pid of the current task
101 $common_comm the name of the current process
103 All of the remaining fields in the event's format file have
104 counterparts as handler function arguments of the same name, as can be
105 seen in the example above.
107 The above provides the basics needed to directly access every field of
109 write a useful trace script. The sections below cover the rest.
126 The rest of the script can contain handler functions and support
129 Aside from the event handler functions discussed above, every script
163 The remaining sections provide descriptions of each of the available
169 The following sections describe the functions and variables available
170 via the various Perf::Trace::* Perl modules. To use the functions and
171 variables from the given module, add the corresponding 'use
180 strings for flag and symbolic fields. These correspond to the strings
181 and values parsed from the 'print fmt' fields of the event format
184 …t_name, $field_name, $field_value) - returns the string representation corresponding to $field_val…
185 …t_name, $field_name, $field_value) - returns the string representation corresponding to $field_val…
190 Some of the 'common' fields in the event format file aren't all that
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
196 $context variable passed into every event handler as the second
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
211 nsecs_str($nsecs) - returns printable string in the form secs.nsecs