Lines Matching refs:sample
286 struct cpu_sample *sample; in pid_put_sample() local
295 sample = zalloc(sizeof(*sample)); in pid_put_sample()
296 assert(sample != NULL); in pid_put_sample()
297 sample->start_time = start; in pid_put_sample()
298 sample->end_time = end; in pid_put_sample()
299 sample->type = type; in pid_put_sample()
300 sample->next = c->samples; in pid_put_sample()
301 sample->cpu = cpu; in pid_put_sample()
302 sample->backtrace = backtrace; in pid_put_sample()
303 c->samples = sample; in pid_put_sample()
305 if (sample->type == TYPE_RUNNING && end > start && start > 0) { in pid_put_sample()
325 struct perf_sample *sample __maybe_unused, in process_comm_event()
335 struct perf_sample *sample __maybe_unused, in process_fork_event()
345 struct perf_sample *sample __maybe_unused, in process_exit_event()
493 struct perf_sample *sample, in cat_backtrace() argument
501 struct ip_callchain *chain = sample->callchain; in cat_backtrace()
513 if (machine__resolve(machine, &al, sample) < 0) { in cat_backtrace()
571 struct perf_sample *sample,
576 struct perf_sample *sample, in process_sample_event() argument
583 if (!tchart->first_time || tchart->first_time > sample->time) in process_sample_event()
584 tchart->first_time = sample->time; in process_sample_event()
585 if (tchart->last_time < sample->time) in process_sample_event()
586 tchart->last_time = sample->time; in process_sample_event()
591 return f(tchart, evsel, sample, in process_sample_event()
592 cat_backtrace(event, sample, machine)); in process_sample_event()
601 struct perf_sample *sample, in process_sample_cpu_idle() argument
604 u32 state = evsel__intval(evsel, sample, "state"); in process_sample_cpu_idle()
605 u32 cpu_id = evsel__intval(evsel, sample, "cpu_id"); in process_sample_cpu_idle()
608 c_state_end(tchart, cpu_id, sample->time); in process_sample_cpu_idle()
610 c_state_start(cpu_id, sample->time, state); in process_sample_cpu_idle()
617 struct perf_sample *sample, in process_sample_cpu_frequency() argument
620 u32 state = evsel__intval(evsel, sample, "state"); in process_sample_cpu_frequency()
621 u32 cpu_id = evsel__intval(evsel, sample, "cpu_id"); in process_sample_cpu_frequency()
623 p_state_change(tchart, cpu_id, sample->time, state); in process_sample_cpu_frequency()
630 struct perf_sample *sample, in process_sample_sched_wakeup() argument
633 u8 flags = evsel__intval(evsel, sample, "common_flags"); in process_sample_sched_wakeup()
634 int waker = evsel__intval(evsel, sample, "common_pid"); in process_sample_sched_wakeup()
635 int wakee = evsel__intval(evsel, sample, "pid"); in process_sample_sched_wakeup()
637 sched_wakeup(tchart, sample->cpu, sample->time, waker, wakee, flags, backtrace); in process_sample_sched_wakeup()
644 struct perf_sample *sample, in process_sample_sched_switch() argument
647 int prev_pid = evsel__intval(evsel, sample, "prev_pid"); in process_sample_sched_switch()
648 int next_pid = evsel__intval(evsel, sample, "next_pid"); in process_sample_sched_switch()
649 u64 prev_state = evsel__intval(evsel, sample, "prev_state"); in process_sample_sched_switch()
651 sched_switch(tchart, sample->cpu, sample->time, prev_pid, next_pid, in process_sample_sched_switch()
660 struct perf_sample *sample, in process_sample_power_start() argument
663 u64 cpu_id = evsel__intval(evsel, sample, "cpu_id"); in process_sample_power_start()
664 u64 value = evsel__intval(evsel, sample, "value"); in process_sample_power_start()
666 c_state_start(cpu_id, sample->time, value); in process_sample_power_start()
673 struct perf_sample *sample, in process_sample_power_end() argument
676 c_state_end(tchart, sample->cpu, sample->time); in process_sample_power_end()
683 struct perf_sample *sample, in process_sample_power_frequency() argument
686 u64 cpu_id = evsel__intval(evsel, sample, "cpu_id"); in process_sample_power_frequency()
687 u64 value = evsel__intval(evsel, sample, "value"); in process_sample_power_frequency()
689 p_state_change(tchart, cpu_id, sample->time, value); in process_sample_power_frequency()
735 struct io_sample *sample; in pid_begin_io_sample() local
757 sample = zalloc(sizeof(*sample)); in pid_begin_io_sample()
758 if (!sample) in pid_begin_io_sample()
760 sample->start_time = start; in pid_begin_io_sample()
761 sample->type = type; in pid_begin_io_sample()
762 sample->fd = fd; in pid_begin_io_sample()
763 sample->next = c->io_samples; in pid_begin_io_sample()
764 c->io_samples = sample; in pid_begin_io_sample()
777 struct io_sample *sample, *prev; in pid_end_io_sample() local
784 sample = c->io_samples; in pid_end_io_sample()
786 if (!sample) /* skip partially captured events */ in pid_end_io_sample()
789 if (sample->end_time) { in pid_end_io_sample()
795 if (sample->type != type) { in pid_end_io_sample()
800 sample->end_time = end; in pid_end_io_sample()
801 prev = sample->next; in pid_end_io_sample()
805 if (sample->end_time - sample->start_time < tchart->min_time) in pid_end_io_sample()
806 sample->end_time = sample->start_time + tchart->min_time; in pid_end_io_sample()
807 if (prev && sample->start_time < prev->end_time) { in pid_end_io_sample()
809 sample->start_time = prev->end_time; in pid_end_io_sample()
811 prev->end_time = sample->start_time; in pid_end_io_sample()
815 sample->err = ret; in pid_end_io_sample()
824 sample->bytes = ret; in pid_end_io_sample()
829 prev->type == sample->type && in pid_end_io_sample()
830 prev->err == sample->err && in pid_end_io_sample()
831 prev->fd == sample->fd && in pid_end_io_sample()
832 prev->end_time + tchart->merge_dist >= sample->start_time) { in pid_end_io_sample()
834 sample->bytes += prev->bytes; in pid_end_io_sample()
835 sample->merges += prev->merges + 1; in pid_end_io_sample()
837 sample->start_time = prev->start_time; in pid_end_io_sample()
838 sample->next = prev->next; in pid_end_io_sample()
841 if (!sample->err && sample->bytes > c->max_bytes) in pid_end_io_sample()
842 c->max_bytes = sample->bytes; in pid_end_io_sample()
853 struct perf_sample *sample) in process_enter_read() argument
855 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_read()
856 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_READ, in process_enter_read()
857 sample->time, fd); in process_enter_read()
863 struct perf_sample *sample) in process_exit_read() argument
865 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_read()
866 return pid_end_io_sample(tchart, sample->tid, IOTYPE_READ, in process_exit_read()
867 sample->time, ret); in process_exit_read()
873 struct perf_sample *sample) in process_enter_write() argument
875 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_write()
876 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_WRITE, in process_enter_write()
877 sample->time, fd); in process_enter_write()
883 struct perf_sample *sample) in process_exit_write() argument
885 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_write()
886 return pid_end_io_sample(tchart, sample->tid, IOTYPE_WRITE, in process_exit_write()
887 sample->time, ret); in process_exit_write()
893 struct perf_sample *sample) in process_enter_sync() argument
895 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_sync()
896 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_SYNC, in process_enter_sync()
897 sample->time, fd); in process_enter_sync()
903 struct perf_sample *sample) in process_exit_sync() argument
905 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_sync()
906 return pid_end_io_sample(tchart, sample->tid, IOTYPE_SYNC, in process_exit_sync()
907 sample->time, ret); in process_exit_sync()
913 struct perf_sample *sample) in process_enter_tx() argument
915 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_tx()
916 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_TX, in process_enter_tx()
917 sample->time, fd); in process_enter_tx()
923 struct perf_sample *sample) in process_exit_tx() argument
925 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_tx()
926 return pid_end_io_sample(tchart, sample->tid, IOTYPE_TX, in process_exit_tx()
927 sample->time, ret); in process_exit_tx()
933 struct perf_sample *sample) in process_enter_rx() argument
935 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_rx()
936 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_RX, in process_enter_rx()
937 sample->time, fd); in process_enter_rx()
943 struct perf_sample *sample) in process_exit_rx() argument
945 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_rx()
946 return pid_end_io_sample(tchart, sample->tid, IOTYPE_RX, in process_exit_rx()
947 sample->time, ret); in process_exit_rx()
953 struct perf_sample *sample) in process_enter_poll() argument
955 long fd = evsel__intval(evsel, sample, "fd"); in process_enter_poll()
956 return pid_begin_io_sample(tchart, sample->tid, IOTYPE_POLL, in process_enter_poll()
957 sample->time, fd); in process_enter_poll()
963 struct perf_sample *sample) in process_exit_poll() argument
965 long ret = evsel__intval(evsel, sample, "ret"); in process_exit_poll()
966 return pid_end_io_sample(tchart, sample->tid, IOTYPE_POLL, in process_exit_poll()
967 sample->time, ret); in process_exit_poll()
1116 struct cpu_sample *sample; in draw_cpu_usage() local
1121 sample = c->samples; in draw_cpu_usage()
1122 while (sample) { in draw_cpu_usage()
1123 if (sample->type == TYPE_RUNNING) { in draw_cpu_usage()
1124 svg_process(sample->cpu, in draw_cpu_usage()
1125 sample->start_time, in draw_cpu_usage()
1126 sample->end_time, in draw_cpu_usage()
1129 sample->backtrace); in draw_cpu_usage()
1132 sample = sample->next; in draw_cpu_usage()
1147 struct io_sample *sample; in draw_io_bars() local
1161 sample = c->io_samples; in draw_io_bars()
1162 for (sample = c->io_samples; sample; sample = sample->next) { in draw_io_bars()
1163 double h = (double)sample->bytes / c->max_bytes; in draw_io_bars()
1166 sample->err == -EAGAIN) in draw_io_bars()
1169 if (sample->err) in draw_io_bars()
1172 if (sample->type == IOTYPE_SYNC) in draw_io_bars()
1174 sample->start_time, in draw_io_bars()
1175 sample->end_time, in draw_io_bars()
1177 sample->err ? "error" : "sync", in draw_io_bars()
1178 sample->fd, in draw_io_bars()
1179 sample->err, in draw_io_bars()
1180 sample->merges); in draw_io_bars()
1181 else if (sample->type == IOTYPE_POLL) in draw_io_bars()
1183 sample->start_time, in draw_io_bars()
1184 sample->end_time, in draw_io_bars()
1186 sample->err ? "error" : "poll", in draw_io_bars()
1187 sample->fd, in draw_io_bars()
1188 sample->err, in draw_io_bars()
1189 sample->merges); in draw_io_bars()
1190 else if (sample->type == IOTYPE_READ) in draw_io_bars()
1192 sample->start_time, in draw_io_bars()
1193 sample->end_time, in draw_io_bars()
1195 sample->err ? "error" : "disk", in draw_io_bars()
1196 sample->fd, in draw_io_bars()
1197 sample->err, in draw_io_bars()
1198 sample->merges); in draw_io_bars()
1199 else if (sample->type == IOTYPE_WRITE) in draw_io_bars()
1201 sample->start_time, in draw_io_bars()
1202 sample->end_time, in draw_io_bars()
1204 sample->err ? "error" : "disk", in draw_io_bars()
1205 sample->fd, in draw_io_bars()
1206 sample->err, in draw_io_bars()
1207 sample->merges); in draw_io_bars()
1208 else if (sample->type == IOTYPE_RX) in draw_io_bars()
1210 sample->start_time, in draw_io_bars()
1211 sample->end_time, in draw_io_bars()
1213 sample->err ? "error" : "net", in draw_io_bars()
1214 sample->fd, in draw_io_bars()
1215 sample->err, in draw_io_bars()
1216 sample->merges); in draw_io_bars()
1217 else if (sample->type == IOTYPE_TX) in draw_io_bars()
1219 sample->start_time, in draw_io_bars()
1220 sample->end_time, in draw_io_bars()
1222 sample->err ? "error" : "net", in draw_io_bars()
1223 sample->fd, in draw_io_bars()
1224 sample->err, in draw_io_bars()
1225 sample->merges); in draw_io_bars()
1259 struct cpu_sample *sample; in draw_process_bars() local
1275 sample = c->samples; in draw_process_bars()
1276 while (sample) { in draw_process_bars()
1277 if (sample->type == TYPE_RUNNING) in draw_process_bars()
1278 svg_running(Y, sample->cpu, in draw_process_bars()
1279 sample->start_time, in draw_process_bars()
1280 sample->end_time, in draw_process_bars()
1281 sample->backtrace); in draw_process_bars()
1282 if (sample->type == TYPE_BLOCKED) in draw_process_bars()
1283 svg_blocked(Y, sample->cpu, in draw_process_bars()
1284 sample->start_time, in draw_process_bars()
1285 sample->end_time, in draw_process_bars()
1286 sample->backtrace); in draw_process_bars()
1287 if (sample->type == TYPE_WAITING) in draw_process_bars()
1288 svg_waiting(Y, sample->cpu, in draw_process_bars()
1289 sample->start_time, in draw_process_bars()
1290 sample->end_time, in draw_process_bars()
1291 sample->backtrace); in draw_process_bars()
1292 sample = sample->next; in draw_process_bars()
1931 .sample = process_sample_event, in cmd_timechart()