Lines Matching refs:sf

182 	struct s390_cpumsf	*sf;  member
195 static int s390_cpumcf_dumpctr(struct s390_cpumsf *sf, in s390_cpumcf_dumpctr() argument
202 if (!sf->use_logfile || sf->queues.nr_queues <= sample->cpu) in s390_cpumcf_dumpctr()
205 q = &sf->queues.queue_array[sample->cpu]; in s390_cpumcf_dumpctr()
213 rc = (sf->logdir) in s390_cpumcf_dumpctr()
215 sf->logdir, sample->cpu) in s390_cpumcf_dumpctr()
432 static void s390_cpumsf_dump(struct s390_cpumsf *sf, in s390_cpumsf_dump() argument
445 if (!s390_cpumsf_validate(sf->machine_type, buf, len, &bsdes, in s390_cpumsf_dump()
449 len, sf->machine_type, bsdes, dsdes); in s390_cpumsf_dump()
493 static void s390_cpumsf_dump_event(struct s390_cpumsf *sf, unsigned char *buf, in s390_cpumsf_dump_event() argument
497 s390_cpumsf_dump(sf, buf, len); in s390_cpumsf_dump_event()
538 if (perf_session__deliver_synth_event(sfq->sf->session, &event, in s390_cpumsf_make_event()
601 struct s390_cpumsf *sf = sfq->sf; in s390_cpumsf_samples() local
610 if (!s390_cpumsf_validate(sf->machine_type, buf, len, &bsdes, in s390_cpumsf_samples()
700 queue = &sfq->sf->queues.queue_array[sfq->queue_nr]; in s390_cpumsf_run_decoder()
730 int fd = perf_data__fd(sfq->sf->session->data); in s390_cpumsf_run_decoder()
767 s390_cpumsf_alloc_queue(struct s390_cpumsf *sf, unsigned int queue_nr) in s390_cpumsf_alloc_queue() argument
775 sfq->sf = sf; in s390_cpumsf_alloc_queue()
778 if (sf->use_logfile) { in s390_cpumsf_alloc_queue()
782 rc = (sf->logdir) in s390_cpumsf_alloc_queue()
784 sf->logdir, queue_nr) in s390_cpumsf_alloc_queue()
791 sf->use_logfile = false; in s390_cpumsf_alloc_queue()
798 static int s390_cpumsf_setup_queue(struct s390_cpumsf *sf, in s390_cpumsf_setup_queue() argument
808 sfq = s390_cpumsf_alloc_queue(sf, queue_nr); in s390_cpumsf_setup_queue()
816 return auxtrace_heap__add(&sf->heap, queue_nr, ts); in s390_cpumsf_setup_queue()
819 static int s390_cpumsf_setup_queues(struct s390_cpumsf *sf, u64 ts) in s390_cpumsf_setup_queues() argument
824 for (i = 0; i < sf->queues.nr_queues; i++) { in s390_cpumsf_setup_queues()
825 ret = s390_cpumsf_setup_queue(sf, &sf->queues.queue_array[i], in s390_cpumsf_setup_queues()
833 static int s390_cpumsf_update_queues(struct s390_cpumsf *sf, u64 ts) in s390_cpumsf_update_queues() argument
835 if (!sf->queues.new_data) in s390_cpumsf_update_queues()
838 sf->queues.new_data = false; in s390_cpumsf_update_queues()
839 return s390_cpumsf_setup_queues(sf, ts); in s390_cpumsf_update_queues()
842 static int s390_cpumsf_process_queues(struct s390_cpumsf *sf, u64 timestamp) in s390_cpumsf_process_queues() argument
852 if (!sf->heap.heap_cnt) in s390_cpumsf_process_queues()
855 if (sf->heap.heap_array[0].ordinal >= timestamp) in s390_cpumsf_process_queues()
858 queue_nr = sf->heap.heap_array[0].queue_nr; in s390_cpumsf_process_queues()
859 queue = &sf->queues.queue_array[queue_nr]; in s390_cpumsf_process_queues()
862 auxtrace_heap__pop(&sf->heap); in s390_cpumsf_process_queues()
863 if (sf->heap.heap_cnt) { in s390_cpumsf_process_queues()
864 ts = sf->heap.heap_array[0].ordinal + 1; in s390_cpumsf_process_queues()
873 auxtrace_heap__add(&sf->heap, queue_nr, ts); in s390_cpumsf_process_queues()
877 ret = auxtrace_heap__add(&sf->heap, queue_nr, ts); in s390_cpumsf_process_queues()
885 static int s390_cpumsf_synth_error(struct s390_cpumsf *sf, int code, int cpu, in s390_cpumsf_synth_error() argument
896 err = perf_session__deliver_synth_event(sf->session, &event, NULL); in s390_cpumsf_synth_error()
903 static int s390_cpumsf_lost(struct s390_cpumsf *sf, struct perf_sample *sample) in s390_cpumsf_lost() argument
905 return s390_cpumsf_synth_error(sf, 1, sample->cpu, in s390_cpumsf_lost()
916 struct s390_cpumsf *sf = container_of(session->auxtrace, in s390_cpumsf_process_event() local
938 err = s390_cpumcf_dumpctr(sf, sample); in s390_cpumsf_process_event()
944 return s390_cpumsf_lost(sf, sample); in s390_cpumsf_process_event()
947 err = s390_cpumsf_update_queues(sf, timestamp); in s390_cpumsf_process_event()
949 err = s390_cpumsf_process_queues(sf, timestamp); in s390_cpumsf_process_event()
964 struct s390_cpumsf *sf = container_of(session->auxtrace, in s390_cpumsf_process_auxtrace_event() local
973 if (sf->data_queued) in s390_cpumsf_process_auxtrace_event()
984 err = auxtrace_queues__add_event(&sf->queues, session, event, in s390_cpumsf_process_auxtrace_event()
992 s390_cpumsf_dump_event(sf, buffer->data, in s390_cpumsf_process_auxtrace_event()
1012 struct s390_cpumsf *sf = container_of(session->auxtrace, in s390_cpumsf_free_queues() local
1015 struct auxtrace_queues *queues = &sf->queues; in s390_cpumsf_free_queues()
1039 struct s390_cpumsf *sf = container_of(session->auxtrace, in s390_cpumsf_free() local
1043 auxtrace_heap__free(&sf->heap); in s390_cpumsf_free()
1046 zfree(&sf->logdir); in s390_cpumsf_free()
1047 free(sf); in s390_cpumsf_free()
1096 struct s390_cpumsf *sf = cb; in s390_cpumsf__config() local
1102 sf->logdir = strdup(value); in s390_cpumsf__config()
1103 if (sf->logdir == NULL) { in s390_cpumsf__config()
1108 rc = stat(sf->logdir, &stbuf); in s390_cpumsf__config()
1112 zfree(&sf->logdir); in s390_cpumsf__config()
1121 struct s390_cpumsf *sf; in s390_cpumsf_process_auxtrace_info() local
1127 sf = zalloc(sizeof(struct s390_cpumsf)); in s390_cpumsf_process_auxtrace_info()
1128 if (sf == NULL) in s390_cpumsf_process_auxtrace_info()
1135 sf->use_logfile = session->itrace_synth_opts->log; in s390_cpumsf_process_auxtrace_info()
1136 if (sf->use_logfile) in s390_cpumsf_process_auxtrace_info()
1137 perf_config(s390_cpumsf__config, sf); in s390_cpumsf_process_auxtrace_info()
1139 err = auxtrace_queues__init(&sf->queues); in s390_cpumsf_process_auxtrace_info()
1143 sf->session = session; in s390_cpumsf_process_auxtrace_info()
1144 sf->machine = &session->machines.host; /* No kvm support */ in s390_cpumsf_process_auxtrace_info()
1145 sf->auxtrace_type = auxtrace_info->type; in s390_cpumsf_process_auxtrace_info()
1146 sf->pmu_type = PERF_TYPE_RAW; in s390_cpumsf_process_auxtrace_info()
1147 sf->machine_type = s390_cpumsf_get_type(session->evlist->env->cpuid); in s390_cpumsf_process_auxtrace_info()
1149 sf->auxtrace.process_event = s390_cpumsf_process_event; in s390_cpumsf_process_auxtrace_info()
1150 sf->auxtrace.process_auxtrace_event = s390_cpumsf_process_auxtrace_event; in s390_cpumsf_process_auxtrace_info()
1151 sf->auxtrace.flush_events = s390_cpumsf_flush; in s390_cpumsf_process_auxtrace_info()
1152 sf->auxtrace.free_events = s390_cpumsf_free_events; in s390_cpumsf_process_auxtrace_info()
1153 sf->auxtrace.free = s390_cpumsf_free; in s390_cpumsf_process_auxtrace_info()
1154 sf->auxtrace.evsel_is_auxtrace = s390_cpumsf_evsel_is_auxtrace; in s390_cpumsf_process_auxtrace_info()
1155 session->auxtrace = &sf->auxtrace; in s390_cpumsf_process_auxtrace_info()
1160 err = auxtrace_queues__process_index(&sf->queues, session); in s390_cpumsf_process_auxtrace_info()
1164 if (sf->queues.populated) in s390_cpumsf_process_auxtrace_info()
1165 sf->data_queued = true; in s390_cpumsf_process_auxtrace_info()
1170 auxtrace_queues__free(&sf->queues); in s390_cpumsf_process_auxtrace_info()
1173 zfree(&sf->logdir); in s390_cpumsf_process_auxtrace_info()
1174 free(sf); in s390_cpumsf_process_auxtrace_info()