Lines Matching full:sample
407 static PyObject *python_process_callchain(struct perf_sample *sample, in python_process_callchain() argument
417 if (!symbol_conf.use_callchain || !sample->callchain) in python_process_callchain()
421 sample, NULL, NULL, in python_process_callchain()
495 static PyObject *python_process_brstack(struct perf_sample *sample, in python_process_brstack() argument
498 struct branch_stack *br = sample->branch_stack; in python_process_brstack()
499 struct branch_entry *entries = perf_sample__branch_entries(sample); in python_process_brstack()
534 thread__find_map_fb(thread, sample->cpumode, in python_process_brstack()
540 thread__find_map_fb(thread, sample->cpumode, in python_process_brstack()
581 static PyObject *python_process_brstacksym(struct perf_sample *sample, in python_process_brstacksym() argument
584 struct branch_stack *br = sample->branch_stack; in python_process_brstacksym()
585 struct branch_entry *entries = perf_sample__branch_entries(sample); in python_process_brstacksym()
605 thread__find_symbol_fb(thread, sample->cpumode, in python_process_brstacksym()
611 thread__find_symbol_fb(thread, sample->cpumode, in python_process_brstacksym()
662 struct perf_sample *sample, in set_sample_read_in_dict() argument
671 PyLong_FromUnsignedLongLong(sample->read.time_enabled)); in set_sample_read_in_dict()
676 PyLong_FromUnsignedLongLong(sample->read.time_running)); in set_sample_read_in_dict()
680 values = PyList_New(sample->read.group.nr); in set_sample_read_in_dict()
688 struct sample_read_value *v = sample->read.group.values; in set_sample_read_in_dict()
691 sample_read_group__for_each(v, sample->read.group.nr, read_format) { in set_sample_read_in_dict()
697 PyObject *t = get_sample_value_as_tuple(&sample->read.one, in set_sample_read_in_dict()
705 struct perf_sample *sample) in set_sample_datasrc_in_dict() argument
707 struct mem_info mi = { .data_src.val = sample->data_src }; in set_sample_datasrc_in_dict()
711 PyLong_FromUnsignedLongLong(sample->data_src)); in set_sample_datasrc_in_dict()
739 struct perf_sample *sample, in set_regs_in_dict() argument
755 regs_map(&sample->intr_regs, attr->sample_regs_intr, arch, bf, sizeof(bf)); in set_regs_in_dict()
760 regs_map(&sample->user_regs, attr->sample_regs_user, arch, bf, sizeof(bf)); in set_regs_in_dict()
805 static void python_process_sample_flags(struct perf_sample *sample, PyObject *dict_sample) in python_process_sample_flags() argument
809 set_sample_flags(dict_sample, sample->flags); in python_process_sample_flags()
810 perf_sample__sprintf_flags(sample->flags, flags_disp, sizeof(flags_disp)); in python_process_sample_flags()
815 static PyObject *get_perf_sample_dict(struct perf_sample *sample, in get_perf_sample_dict() argument
835 _PyLong_FromLong(sample->pid)); in get_perf_sample_dict()
837 _PyLong_FromLong(sample->tid)); in get_perf_sample_dict()
839 _PyLong_FromLong(sample->cpu)); in get_perf_sample_dict()
841 PyLong_FromUnsignedLongLong(sample->ip)); in get_perf_sample_dict()
843 PyLong_FromUnsignedLongLong(sample->time)); in get_perf_sample_dict()
845 PyLong_FromUnsignedLongLong(sample->period)); in get_perf_sample_dict()
847 PyLong_FromUnsignedLongLong(sample->phys_addr)); in get_perf_sample_dict()
849 PyLong_FromUnsignedLongLong(sample->addr)); in get_perf_sample_dict()
850 set_sample_read_in_dict(dict_sample, sample, evsel); in get_perf_sample_dict()
852 PyLong_FromUnsignedLongLong(sample->weight)); in get_perf_sample_dict()
854 PyLong_FromUnsignedLongLong(sample->transaction)); in get_perf_sample_dict()
855 set_sample_datasrc_in_dict(dict_sample, sample); in get_perf_sample_dict()
856 pydict_set_item_string_decref(dict, "sample", dict_sample); in get_perf_sample_dict()
859 (const char *)sample->raw_data, sample->raw_size)); in get_perf_sample_dict()
867 brstack = python_process_brstack(sample, al->thread); in get_perf_sample_dict()
870 brstacksym = python_process_brstacksym(sample, al->thread); in get_perf_sample_dict()
873 if (sample->machine_pid) { in get_perf_sample_dict()
875 _PyLong_FromLong(sample->machine_pid)); in get_perf_sample_dict()
877 _PyLong_FromLong(sample->vcpu)); in get_perf_sample_dict()
881 _PyLong_FromLong((unsigned long)sample->cpumode)); in get_perf_sample_dict()
891 if (sample->flags) in get_perf_sample_dict()
892 python_process_sample_flags(sample, dict_sample); in get_perf_sample_dict()
895 if (sample->insn_cnt && sample->cyc_cnt) { in get_perf_sample_dict()
897 PyLong_FromUnsignedLongLong(sample->insn_cnt)); in get_perf_sample_dict()
899 PyLong_FromUnsignedLongLong(sample->cyc_cnt)); in get_perf_sample_dict()
902 set_regs_in_dict(dict, sample, evsel); in get_perf_sample_dict()
907 static void python_process_tracepoint(struct perf_sample *sample, in python_process_tracepoint() argument
920 int cpu = sample->cpu; in python_process_tracepoint()
921 void *data = sample->raw_data; in python_process_tracepoint()
922 unsigned long long nsecs = sample->time; in python_process_tracepoint()
963 callchain = python_process_callchain(sample, evsel, al); in python_process_tracepoint()
1019 all_entries_dict = get_perf_sample_dict(sample, evsel, al, addr_al, in python_process_tracepoint()
1277 tuple_set_d64(t, 8, es->sample->ip); in python_export_sample_table()
1278 tuple_set_d64(t, 9, es->sample->time); in python_export_sample_table()
1279 tuple_set_s32(t, 10, es->sample->cpu); in python_export_sample_table()
1283 tuple_set_d64(t, 14, es->sample->addr); in python_export_sample_table()
1284 tuple_set_d64(t, 15, es->sample->period); in python_export_sample_table()
1285 tuple_set_d64(t, 16, es->sample->weight); in python_export_sample_table()
1286 tuple_set_d64(t, 17, es->sample->transaction); in python_export_sample_table()
1287 tuple_set_d64(t, 18, es->sample->data_src); in python_export_sample_table()
1288 tuple_set_s32(t, 19, es->sample->flags & PERF_BRANCH_MASK); in python_export_sample_table()
1289 tuple_set_s32(t, 20, !!(es->sample->flags & PERF_IP_FLAG_IN_TX)); in python_export_sample_table()
1291 tuple_set_d64(t, 22, es->sample->insn_cnt); in python_export_sample_table()
1292 tuple_set_d64(t, 23, es->sample->cyc_cnt); in python_export_sample_table()
1293 tuple_set_s32(t, 24, es->sample->flags); in python_export_sample_table()
1309 tuple_set_bytes(t, 2, es->sample->raw_data, es->sample->raw_size); in python_export_synth()
1385 struct perf_sample *sample, in python_export_context_switch() argument
1396 tuple_set_d64(t, 2, sample->time); in python_export_context_switch()
1397 tuple_set_s32(t, 3, sample->cpu); in python_export_context_switch()
1419 static void python_process_general_event(struct perf_sample *sample, in python_process_general_event() argument
1443 callchain = python_process_callchain(sample, evsel, al); in python_process_general_event()
1444 dict = get_perf_sample_dict(sample, evsel, al, addr_al, callchain); in python_process_general_event()
1456 struct perf_sample *sample, in python_process_event() argument
1463 scripting_context__update(scripting_context, event, sample, evsel, al, addr_al); in python_process_event()
1467 python_process_tracepoint(sample, evsel, al, addr_al); in python_process_event()
1472 db_export__sample(&tables->dbe, event, sample, evsel, al, addr_al); in python_process_event()
1474 python_process_general_event(sample, evsel, al, addr_al); in python_process_event()
1479 struct perf_sample *sample, in python_process_throttle() argument
1500 tuple_set_s32(t, 3, sample->cpu); in python_process_throttle()
1501 tuple_set_s32(t, 4, sample->pid); in python_process_throttle()
1502 tuple_set_s32(t, 5, sample->tid); in python_process_throttle()
1510 struct perf_sample *sample, in python_do_process_switch() argument
1532 tuple_set_u64(t, 0, sample->time); in python_do_process_switch()
1533 tuple_set_s32(t, 1, sample->cpu); in python_do_process_switch()
1534 tuple_set_s32(t, 2, sample->pid); in python_do_process_switch()
1535 tuple_set_s32(t, 3, sample->tid); in python_do_process_switch()
1541 tuple_set_s32(t, 9, sample->machine_pid); in python_do_process_switch()
1542 tuple_set_s32(t, 10, sample->vcpu); in python_do_process_switch()
1550 struct perf_sample *sample, in python_process_switch() argument
1556 db_export__switch(&tables->dbe, event, sample, machine); in python_process_switch()
1558 python_do_process_switch(event, sample, machine); in python_process_switch()
1839 SET_TABLE_HANDLER(sample); in set_table_handlers()
1846 * stored in sample->raw_data. They are exported via in set_table_handlers()
2124 fprintf(ofp, "\t\tprint('Sample: {'+" in python_generate_script()
2125 "get_dict_as_string(perf_sample_dict['sample'], ', ')+'}')\n\n"); in python_generate_script()
2144 fprintf(ofp, "\t\tprint('Sample: {'+" in python_generate_script()
2145 "get_dict_as_string(perf_sample_dict['sample'], ', ')+'}')\n\n"); in python_generate_script()