Lines Matching full:sample
285 struct cpu_sample *sample; in pid_put_sample() local
294 sample = zalloc(sizeof(*sample)); in pid_put_sample()
295 assert(sample != NULL); in pid_put_sample()
296 sample->start_time = start; in pid_put_sample()
297 sample->end_time = end; in pid_put_sample()
298 sample->type = type; in pid_put_sample()
299 sample->next = c->samples; in pid_put_sample()
300 sample->cpu = cpu; in pid_put_sample()
301 sample->backtrace = backtrace; in pid_put_sample()
302 c->samples = sample; in pid_put_sample()
304 if (sample->type == TYPE_RUNNING && end > start && start > 0) { in pid_put_sample()
324 struct perf_sample *sample __maybe_unused, in process_comm_event()
334 struct perf_sample *sample __maybe_unused, in process_fork_event()
344 struct perf_sample *sample __maybe_unused, in process_exit_event()
492 struct perf_sample *sample, in cat_backtrace() argument
501 struct ip_callchain *chain = sample->callchain; in cat_backtrace()
512 if (machine__resolve(machine, &al, sample) < 0) { in cat_backtrace()
567 struct perf_sample *sample,
572 struct perf_sample *sample, in process_sample_event() argument
579 if (!tchart->first_time || tchart->first_time > sample->time) in process_sample_event()
580 tchart->first_time = sample->time; in process_sample_event()
581 if (tchart->last_time < sample->time) in process_sample_event()
582 tchart->last_time = sample->time; in process_sample_event()
587 return f(tchart, evsel, sample, in process_sample_event()
588 cat_backtrace(event, sample, machine)); in process_sample_event()
597 struct perf_sample *sample, in process_sample_cpu_idle() argument
600 u32 state = evsel__intval(evsel, sample, "state"); in process_sample_cpu_idle()
601 u32 cpu_id = evsel__intval(evsel, sample, "cpu_id"); in process_sample_cpu_idle()
604 c_state_end(tchart, cpu_id, sample->time); in process_sample_cpu_idle()
606 c_state_start(cpu_id, sample->time, state); in process_sample_cpu_idle()
613 struct perf_sample *sample, in process_sample_cpu_frequency() argument
616 u32 state = evsel__intval(evsel, sample, "state"); in process_sample_cpu_frequency()
617 u32 cpu_id = evsel__intval(evsel, sample, "cpu_id"); in process_sample_cpu_frequency()
619 p_state_change(tchart, cpu_id, sample->time, state); in process_sample_cpu_frequency()
626 struct perf_sample *sample, in process_sample_sched_wakeup() argument
629 u8 flags = evsel__intval(evsel, sample, "common_flags"); in process_sample_sched_wakeup()
630 int waker = evsel__intval(evsel, sample, "common_pid"); in process_sample_sched_wakeup()
631 int wakee = evsel__intval(evsel, sample, "pid"); in process_sample_sched_wakeup()
633 sched_wakeup(tchart, sample->cpu, sample->time, waker, wakee, flags, backtrace); in process_sample_sched_wakeup()
640 struct perf_sample *sample, in process_sample_sched_switch() argument
643 int prev_pid = evsel__intval(evsel, sample, "prev_pid"); in process_sample_sched_switch()
644 int next_pid = evsel__intval(evsel, sample, "next_pid"); in process_sample_sched_switch()
645 u64 prev_state = evsel__intval(evsel, sample, "prev_state"); in process_sample_sched_switch()
647 sched_switch(tchart, sample->cpu, sample->time, prev_pid, next_pid, in process_sample_sched_switch()
656 struct perf_sample *sample, in process_sample_power_start() argument
659 u64 cpu_id = evsel__intval(evsel, sample, "cpu_id"); in process_sample_power_start()
660 u64 value = evsel__intval(evsel, sample, "value"); in process_sample_power_start()
662 c_state_start(cpu_id, sample->time, value); in process_sample_power_start()
669 struct perf_sample *sample, in process_sample_power_end() argument
672 c_state_end(tchart, sample->cpu, sample->time); in process_sample_power_end()
679 struct perf_sample *sample, in process_sample_power_frequency() argument
682 u64 cpu_id = evsel__intval(evsel, sample, "cpu_id"); in process_sample_power_frequency()
683 u64 value = evsel__intval(evsel, sample, "value"); in process_sample_power_frequency()
685 p_state_change(tchart, cpu_id, sample->time, value); in process_sample_power_frequency()
691 * After the last sample we need to wrap up the current C/P state
731 struct io_sample *sample; in pid_begin_io_sample() local
753 sample = zalloc(sizeof(*sample)); in pid_begin_io_sample()
754 if (!sample) in pid_begin_io_sample()
756 sample->start_time = start; in pid_begin_io_sample()
757 sample->type = type; in pid_begin_io_sample()
758 sample->fd = fd; in pid_begin_io_sample()
759 sample->next = c->io_samples; in pid_begin_io_sample()
760 c->io_samples = sample; in pid_begin_io_sample()
773 struct io_sample *sample, *prev; in pid_end_io_sample() local
780 sample = c->io_samples; in pid_end_io_sample()
782 if (!sample) /* skip partially captured events */ in pid_end_io_sample()
785 if (sample->end_time) { in pid_end_io_sample()
791 if (sample->type != type) { in pid_end_io_sample()
796 sample->end_time = end; in pid_end_io_sample()
797 prev = sample->next; in pid_end_io_sample()
801 if (sample->end_time - sample->start_time < tchart->min_time) in pid_end_io_sample()
802 sample->end_time = sample->start_time + tchart->min_time; in pid_end_io_sample()
803 if (prev && sample->start_time < prev->end_time) { in pid_end_io_sample()
805 sample->start_time = prev->end_time; in pid_end_io_sample()
807 prev->end_time = sample->start_time; in pid_end_io_sample()
811 sample->err = ret; in pid_end_io_sample()
820 sample->bytes = ret; in pid_end_io_sample()
825 prev->type == sample->type && in pid_end_io_sample()
826 prev->err == sample->err && in pid_end_io_sample()
827 prev->fd == sample->fd && in pid_end_io_sample()
828 prev->end_time + tchart->merge_dist >= sample->start_time) { in pid_end_io_sample()
830 sample->bytes += prev->bytes; in pid_end_io_sample()
831 sample->merges += prev->merges + 1; in pid_end_io_sample()
833 sample->start_time = prev->start_time; in pid_end_io_sample()
834 sample->next = prev->next; in pid_end_io_sample()
837 if (!sample->err && sample->bytes > c->max_bytes) in pid_end_io_sample()
838 c->max_bytes = sample->bytes; in pid_end_io_sample()
849 struct perf_sample *sample) in process_enter_read() argument
851 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_read()
852 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_READ, in process_enter_read()
853 sample->time, fd); in process_enter_read()
859 struct perf_sample *sample) in process_exit_read() argument
861 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_read()
862 return pid_end_io_sample(tchart, sample->tid, IOTYPE_READ, in process_exit_read()
863 sample->time, ret); in process_exit_read()
869 struct perf_sample *sample) in process_enter_write() argument
871 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_write()
872 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_WRITE, in process_enter_write()
873 sample->time, fd); in process_enter_write()
879 struct perf_sample *sample) in process_exit_write() argument
881 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_write()
882 return pid_end_io_sample(tchart, sample->tid, IOTYPE_WRITE, in process_exit_write()
883 sample->time, ret); in process_exit_write()
889 struct perf_sample *sample) in process_enter_sync() argument
891 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_sync()
892 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_SYNC, in process_enter_sync()
893 sample->time, fd); in process_enter_sync()
899 struct perf_sample *sample) in process_exit_sync() argument
901 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_sync()
902 return pid_end_io_sample(tchart, sample->tid, IOTYPE_SYNC, in process_exit_sync()
903 sample->time, ret); in process_exit_sync()
909 struct perf_sample *sample) in process_enter_tx() argument
911 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_tx()
912 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_TX, in process_enter_tx()
913 sample->time, fd); in process_enter_tx()
919 struct perf_sample *sample) in process_exit_tx() argument
921 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_tx()
922 return pid_end_io_sample(tchart, sample->tid, IOTYPE_TX, in process_exit_tx()
923 sample->time, ret); in process_exit_tx()
929 struct perf_sample *sample) in process_enter_rx() argument
931 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_rx()
932 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_RX, in process_enter_rx()
933 sample->time, fd); in process_enter_rx()
939 struct perf_sample *sample) in process_exit_rx() argument
941 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_rx()
942 return pid_end_io_sample(tchart, sample->tid, IOTYPE_RX, in process_exit_rx()
943 sample->time, ret); in process_exit_rx()
949 struct perf_sample *sample) in process_enter_poll() argument
951 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_poll()
952 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_POLL, in process_enter_poll()
953 sample->time, fd); in process_enter_poll()
959 struct perf_sample *sample) in process_exit_poll() argument
961 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_poll()
962 return pid_end_io_sample(tchart, sample->tid, IOTYPE_POLL, in process_exit_poll()
963 sample->time, ret); in process_exit_poll()
1112 struct cpu_sample *sample; in draw_cpu_usage() local
1117 sample = c->samples; in draw_cpu_usage()
1118 while (sample) { in draw_cpu_usage()
1119 if (sample->type == TYPE_RUNNING) { in draw_cpu_usage()
1120 svg_process(sample->cpu, in draw_cpu_usage()
1121 sample->start_time, in draw_cpu_usage()
1122 sample->end_time, in draw_cpu_usage()
1125 sample->backtrace); in draw_cpu_usage()
1128 sample = sample->next; in draw_cpu_usage()
1143 struct io_sample *sample; in draw_io_bars() local
1157 sample = c->io_samples; in draw_io_bars()
1158 for (sample = c->io_samples; sample; sample = sample->next) { in draw_io_bars()
1159 double h = (double)sample->bytes / c->max_bytes; in draw_io_bars()
1162 sample->err == -EAGAIN) in draw_io_bars()
1165 if (sample->err) in draw_io_bars()
1168 if (sample->type == IOTYPE_SYNC) in draw_io_bars()
1170 sample->start_time, in draw_io_bars()
1171 sample->end_time, in draw_io_bars()
1173 sample->err ? "error" : "sync", in draw_io_bars()
1174 sample->fd, in draw_io_bars()
1175 sample->err, in draw_io_bars()
1176 sample->merges); in draw_io_bars()
1177 else if (sample->type == IOTYPE_POLL) in draw_io_bars()
1179 sample->start_time, in draw_io_bars()
1180 sample->end_time, in draw_io_bars()
1182 sample->err ? "error" : "poll", in draw_io_bars()
1183 sample->fd, in draw_io_bars()
1184 sample->err, in draw_io_bars()
1185 sample->merges); in draw_io_bars()
1186 else if (sample->type == IOTYPE_READ) in draw_io_bars()
1188 sample->start_time, in draw_io_bars()
1189 sample->end_time, in draw_io_bars()
1191 sample->err ? "error" : "disk", in draw_io_bars()
1192 sample->fd, in draw_io_bars()
1193 sample->err, in draw_io_bars()
1194 sample->merges); in draw_io_bars()
1195 else if (sample->type == IOTYPE_WRITE) in draw_io_bars()
1197 sample->start_time, in draw_io_bars()
1198 sample->end_time, in draw_io_bars()
1200 sample->err ? "error" : "disk", in draw_io_bars()
1201 sample->fd, in draw_io_bars()
1202 sample->err, in draw_io_bars()
1203 sample->merges); in draw_io_bars()
1204 else if (sample->type == IOTYPE_RX) in draw_io_bars()
1206 sample->start_time, in draw_io_bars()
1207 sample->end_time, in draw_io_bars()
1209 sample->err ? "error" : "net", in draw_io_bars()
1210 sample->fd, in draw_io_bars()
1211 sample->err, in draw_io_bars()
1212 sample->merges); in draw_io_bars()
1213 else if (sample->type == IOTYPE_TX) in draw_io_bars()
1215 sample->start_time, in draw_io_bars()
1216 sample->end_time, in draw_io_bars()
1218 sample->err ? "error" : "net", in draw_io_bars()
1219 sample->fd, in draw_io_bars()
1220 sample->err, in draw_io_bars()
1221 sample->merges); in draw_io_bars()
1255 struct cpu_sample *sample; in draw_process_bars() local
1271 sample = c->samples; in draw_process_bars()
1272 while (sample) { in draw_process_bars()
1273 if (sample->type == TYPE_RUNNING) in draw_process_bars()
1274 svg_running(Y, sample->cpu, in draw_process_bars()
1275 sample->start_time, in draw_process_bars()
1276 sample->end_time, in draw_process_bars()
1277 sample->backtrace); in draw_process_bars()
1278 if (sample->type == TYPE_BLOCKED) in draw_process_bars()
1279 svg_blocked(Y, sample->cpu, in draw_process_bars()
1280 sample->start_time, in draw_process_bars()
1281 sample->end_time, in draw_process_bars()
1282 sample->backtrace); in draw_process_bars()
1283 if (sample->type == TYPE_WAITING) in draw_process_bars()
1284 svg_waiting(Y, sample->cpu, in draw_process_bars()
1285 sample->start_time, in draw_process_bars()
1286 sample->end_time, in draw_process_bars()
1287 sample->backtrace); in draw_process_bars()
1288 sample = sample->next; in draw_process_bars()
1927 .sample = process_sample_event, in cmd_timechart()