Since common_callchain has been added to the argument array, we need to reflect it in perl-based scripts, because otherwise the following args would be shifted and thus incorrect. E.g. rw-by-pid and calculation of read and written bytes: Before: read counts by pid: pid comm # reads bytes_requested bytes_read ------ -------------------- ----------- ---------- ---------- 19301 dd 4 424510450039736 0 After: read counts by pid: pid comm # reads bytes_requested bytes_read ------ -------------------- ----------- ---------- ---------- 19301 dd 4 9536 4341 Committer testing: To see before after first do: # perf script record rw-by-pid ^C Now you'll have a perf.data file to report on, then do before and after using: # perf script report rw-by-pid Anbd notice the bytes_request/bytes_read, as above.
Showing the changes to tools/perf/scripts (6 of 6 files). Show all
Unified · Split
| @@ -28,7 +28,7 @@ sub trace_end · 27 unmodified lines | ||
| 28 | 28 | sub irq::softirq_entry |
| 29 | 29 | { |
| 30 | 30 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 31 | − $common_pid, $common_comm, | |
| 31 | + $common_pid, $common_comm, $common_callchain, | |
| 32 | 32 | $vec) = @_; |
| 33 | 33 | |
| 34 | 34 | print_header($event_name, $common_cpu, $common_secs, $common_nsecs, |
| @@ -43,7 +43,7 @@ sub irq::softirq_entry · 8 unmodified lines | ||
| 43 | 43 | sub kmem::kmalloc |
| 44 | 44 | { |
| 45 | 45 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 46 | − $common_pid, $common_comm, | |
| 46 | + $common_pid, $common_comm, $common_callchain, | |
| 47 | 47 | $call_site, $ptr, $bytes_req, $bytes_alloc, |
| 48 | 48 | $gfp_flags) = @_; |
| 49 | 49 | |
| @@ -92,7 +92,7 @@ sub print_unhandled · 42 unmodified lines | ||
| 92 | 92 | sub trace_unhandled |
| 93 | 93 | { |
| 94 | 94 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 95 | − $common_pid, $common_comm) = @_; | |
| 95 | + $common_pid, $common_comm, $common_callchain) = @_; | |
| 96 | 96 | |
| 97 | 97 | $unhandled{$event_name}++; |
| 98 | 98 | } |
| @@ -18,7 +18,7 @@ my %failed_syscalls; · 17 unmodified lines | ||
| 18 | 18 | sub raw_syscalls::sys_exit |
| 19 | 19 | { |
| 20 | 20 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 21 | − $common_pid, $common_comm, | |
| 21 | + $common_pid, $common_comm, $common_callchain, | |
| 22 | 22 | $id, $ret) = @_; |
| 23 | 23 | |
| 24 | 24 | if ($ret < 0) { |
| @@ -28,7 +28,7 @@ my %writes; · 27 unmodified lines | ||
| 28 | 28 | sub syscalls::sys_enter_read |
| 29 | 29 | { |
| 30 | 30 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 31 | − $common_pid, $common_comm, $nr, $fd, $buf, $count) = @_; | |
| 31 | + $common_pid, $common_comm, $common_callchain, $nr, $fd, $buf, $count) = @_; | |
| 32 | 32 | |
| 33 | 33 | if ($common_comm eq $for_comm) { |
| 34 | 34 | $reads{$fd}{bytes_requested} += $count; |
| @@ -39,7 +39,7 @@ sub syscalls::sys_enter_read · 4 unmodified lines | ||
| 39 | 39 | sub syscalls::sys_enter_write |
| 40 | 40 | { |
| 41 | 41 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 42 | − $common_pid, $common_comm, $nr, $fd, $buf, $count) = @_; | |
| 42 | + $common_pid, $common_comm, $common_callchain, $nr, $fd, $buf, $count) = @_; | |
| 43 | 43 | |
| 44 | 44 | if ($common_comm eq $for_comm) { |
| 45 | 45 | $writes{$fd}{bytes_written} += $count; |
| @@ -98,7 +98,7 @@ sub print_unhandled · 52 unmodified lines | ||
| 98 | 98 | sub trace_unhandled |
| 99 | 99 | { |
| 100 | 100 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 101 | − $common_pid, $common_comm) = @_; | |
| 101 | + $common_pid, $common_comm, $common_callchain) = @_; | |
| 102 | 102 | |
| 103 | 103 | $unhandled{$event_name}++; |
| 104 | 104 | } |
| @@ -24,7 +24,7 @@ my %writes; · 23 unmodified lines | ||
| 24 | 24 | sub syscalls::sys_exit_read |
| 25 | 25 | { |
| 26 | 26 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 27 | − $common_pid, $common_comm, | |
| 27 | + $common_pid, $common_comm, $common_callchain, | |
| 28 | 28 | $nr, $ret) = @_; |
| 29 | 29 | |
| 30 | 30 | if ($ret > 0) { |
| @@ -40,7 +40,7 @@ sub syscalls::sys_exit_read · 9 unmodified lines | ||
| 40 | 40 | sub syscalls::sys_enter_read |
| 41 | 41 | { |
| 42 | 42 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 43 | − $common_pid, $common_comm, | |
| 43 | + $common_pid, $common_comm, $common_callchain, | |
| 44 | 44 | $nr, $fd, $buf, $count) = @_; |
| 45 | 45 | |
| 46 | 46 | $reads{$common_pid}{bytes_requested} += $count; |
| @@ -51,7 +51,7 @@ sub syscalls::sys_enter_read · 4 unmodified lines | ||
| 51 | 51 | sub syscalls::sys_exit_write |
| 52 | 52 | { |
| 53 | 53 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 54 | − $common_pid, $common_comm, | |
| 54 | + $common_pid, $common_comm, $common_callchain, | |
| 55 | 55 | $nr, $ret) = @_; |
| 56 | 56 | |
| 57 | 57 | if ($ret <= 0) { |
| @@ -62,7 +62,7 @@ sub syscalls::sys_exit_write · 4 unmodified lines | ||
| 62 | 62 | sub syscalls::sys_enter_write |
| 63 | 63 | { |
| 64 | 64 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 65 | − $common_pid, $common_comm, | |
| 65 | + $common_pid, $common_comm, $common_callchain, | |
| 66 | 66 | $nr, $fd, $buf, $count) = @_; |
| 67 | 67 | |
| 68 | 68 | $writes{$common_pid}{bytes_written} += $count; |
| @@ -178,7 +178,7 @@ sub print_unhandled · 109 unmodified lines | ||
| 178 | 178 | sub trace_unhandled |
| 179 | 179 | { |
| 180 | 180 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 181 | − $common_pid, $common_comm) = @_; | |
| 181 | + $common_pid, $common_comm, $common_callchain) = @_; | |
| 182 | 182 | |
| 183 | 183 | $unhandled{$event_name}++; |
| 184 | 184 | } |
| @@ -35,7 +35,7 @@ if (!$interval) { · 34 unmodified lines | ||
| 35 | 35 | sub syscalls::sys_exit_read |
| 36 | 36 | { |
| 37 | 37 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 38 | − $common_pid, $common_comm, | |
| 38 | + $common_pid, $common_comm, $common_callchain, | |
| 39 | 39 | $nr, $ret) = @_; |
| 40 | 40 | |
| 41 | 41 | print_check(); |
| @@ -53,7 +53,7 @@ sub syscalls::sys_exit_read · 11 unmodified lines | ||
| 53 | 53 | sub syscalls::sys_enter_read |
| 54 | 54 | { |
| 55 | 55 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 56 | − $common_pid, $common_comm, | |
| 56 | + $common_pid, $common_comm, $common_callchain, | |
| 57 | 57 | $nr, $fd, $buf, $count) = @_; |
| 58 | 58 | |
| 59 | 59 | print_check(); |
| @@ -66,7 +66,7 @@ sub syscalls::sys_enter_read · 6 unmodified lines | ||
| 66 | 66 | sub syscalls::sys_exit_write |
| 67 | 67 | { |
| 68 | 68 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 69 | − $common_pid, $common_comm, | |
| 69 | + $common_pid, $common_comm, $common_callchain, | |
| 70 | 70 | $nr, $ret) = @_; |
| 71 | 71 | |
| 72 | 72 | print_check(); |
| @@ -79,7 +79,7 @@ sub syscalls::sys_exit_write · 6 unmodified lines | ||
| 79 | 79 | sub syscalls::sys_enter_write |
| 80 | 80 | { |
| 81 | 81 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 82 | − $common_pid, $common_comm, | |
| 82 | + $common_pid, $common_comm, $common_callchain, | |
| 83 | 83 | $nr, $fd, $buf, $count) = @_; |
| 84 | 84 | |
| 85 | 85 | print_check(); |
| @@ -197,7 +197,7 @@ sub print_unhandled · 111 unmodified lines | ||
| 197 | 197 | sub trace_unhandled |
| 198 | 198 | { |
| 199 | 199 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 200 | − $common_pid, $common_comm) = @_; | |
| 200 | + $common_pid, $common_comm, $common_callchain) = @_; | |
| 201 | 201 | |
| 202 | 202 | $unhandled{$event_name}++; |
| 203 | 203 | } |
| @@ -28,7 +28,7 @@ my $total_wakeups = 0; · 27 unmodified lines | ||
| 28 | 28 | sub sched::sched_switch |
| 29 | 29 | { |
| 30 | 30 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 31 | − $common_pid, $common_comm, | |
| 31 | + $common_pid, $common_comm, $common_callchain, | |
| 32 | 32 | $prev_comm, $prev_pid, $prev_prio, $prev_state, $next_comm, $next_pid, |
| 33 | 33 | $next_prio) = @_; |
| 34 | 34 | |
| @@ -51,7 +51,7 @@ sub sched::sched_switch · 16 unmodified lines | ||
| 51 | 51 | sub sched::sched_wakeup |
| 52 | 52 | { |
| 53 | 53 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 54 | − $common_pid, $common_comm, | |
| 54 | + $common_pid, $common_comm, $common_callchain, | |
| 55 | 55 | $comm, $pid, $prio, $success, $target_cpu) = @_; |
| 56 | 56 | |
| 57 | 57 | $last_wakeup{$target_cpu}{ts} = nsecs($common_secs, $common_nsecs); |
| @@ -101,7 +101,7 @@ sub print_unhandled · 43 unmodified lines | ||
| 101 | 101 | sub trace_unhandled |
| 102 | 102 | { |
| 103 | 103 | my ($event_name, $context, $common_cpu, $common_secs, $common_nsecs, |
| 104 | − $common_pid, $common_comm) = @_; | |
| 104 | + $common_pid, $common_comm, $common_callchain) = @_; | |
| 105 | 105 | |
| 106 | 106 | $unhandled{$event_name}++; |
| 107 | 107 | } |