Lines Matching refs:sfq
198 struct s390_cpumsf_queue *sfq; in s390_cpumcf_dumpctr() local
206 sfq = q->priv; in s390_cpumcf_dumpctr()
207 if (!sfq) /* Queue not yet allocated */ in s390_cpumcf_dumpctr()
210 if (!sfq->logfile_ctr) { in s390_cpumcf_dumpctr()
218 sfq->logfile_ctr = fopen(name, "w"); in s390_cpumcf_dumpctr()
219 if (sfq->logfile_ctr == NULL) { in s390_cpumcf_dumpctr()
227 if (sfq->logfile_ctr) { in s390_cpumcf_dumpctr()
230 sfq->logfile_ctr); in s390_cpumcf_dumpctr()
504 struct s390_cpumsf_queue *sfq) in s390_cpumsf_make_event() argument
511 .cpu = sfq->cpu, in s390_cpumsf_make_event()
538 if (perf_session__deliver_synth_event(sfq->sf->session, &event, in s390_cpumsf_make_event()
599 static int s390_cpumsf_samples(struct s390_cpumsf_queue *sfq, u64 *ts) in s390_cpumsf_samples() argument
601 struct s390_cpumsf *sf = sfq->sf; in s390_cpumsf_samples()
602 unsigned char *buf = sfq->buffer->use_data; in s390_cpumsf_samples()
603 size_t len = sfq->buffer->use_size; in s390_cpumsf_samples()
624 (s64)sfq->buffer->data_offset); in s390_cpumsf_samples()
636 if (s390_cpumsf_make_event(pos, basic, sfq)) in s390_cpumsf_samples()
659 sfq->buffer->use_data += pos; in s390_cpumsf_samples()
660 sfq->buffer->use_size -= pos; in s390_cpumsf_samples()
667 sfq->buffer->use_size = 0; in s390_cpumsf_samples()
668 sfq->buffer->use_data = NULL; in s390_cpumsf_samples()
692 static int s390_cpumsf_run_decoder(struct s390_cpumsf_queue *sfq, in s390_cpumsf_run_decoder() argument
700 queue = &sfq->sf->queues.queue_array[sfq->queue_nr]; in s390_cpumsf_run_decoder()
708 if (sfq->buffer == NULL) { in s390_cpumsf_run_decoder()
709 sfq->buffer = buffer = auxtrace_buffer__next(queue, in s390_cpumsf_run_decoder()
710 sfq->buffer); in s390_cpumsf_run_decoder()
720 if (sfq->logfile) { /* Write into log file */ in s390_cpumsf_run_decoder()
722 sfq->logfile); in s390_cpumsf_run_decoder()
727 buffer = sfq->buffer; in s390_cpumsf_run_decoder()
730 int fd = perf_data__fd(sfq->sf->session->data); in s390_cpumsf_run_decoder()
738 if (sfq->logfile) { /* Write into log file */ in s390_cpumsf_run_decoder()
740 sfq->logfile); in s390_cpumsf_run_decoder()
746 __func__, sfq->queue_nr, buffer->buffer_nr, buffer->offset, in s390_cpumsf_run_decoder()
748 err = s390_cpumsf_samples(sfq, ts); in s390_cpumsf_run_decoder()
757 sfq->buffer = NULL; in s390_cpumsf_run_decoder()
769 struct s390_cpumsf_queue *sfq; in s390_cpumsf_alloc_queue() local
771 sfq = zalloc(sizeof(struct s390_cpumsf_queue)); in s390_cpumsf_alloc_queue()
772 if (sfq == NULL) in s390_cpumsf_alloc_queue()
775 sfq->sf = sf; in s390_cpumsf_alloc_queue()
776 sfq->queue_nr = queue_nr; in s390_cpumsf_alloc_queue()
777 sfq->cpu = -1; in s390_cpumsf_alloc_queue()
787 sfq->logfile = fopen(name, "w"); in s390_cpumsf_alloc_queue()
788 if (sfq->logfile == NULL) { in s390_cpumsf_alloc_queue()
795 return sfq; in s390_cpumsf_alloc_queue()
802 struct s390_cpumsf_queue *sfq = queue->priv; in s390_cpumsf_setup_queue() local
807 if (sfq == NULL) { in s390_cpumsf_setup_queue()
808 sfq = s390_cpumsf_alloc_queue(sf, queue_nr); in s390_cpumsf_setup_queue()
809 if (!sfq) in s390_cpumsf_setup_queue()
811 queue->priv = sfq; in s390_cpumsf_setup_queue()
814 sfq->cpu = queue->cpu; in s390_cpumsf_setup_queue()
850 struct s390_cpumsf_queue *sfq; in s390_cpumsf_process_queues() local
860 sfq = queue->priv; in s390_cpumsf_process_queues()
871 ret = s390_cpumsf_run_decoder(sfq, &ts); in s390_cpumsf_process_queues()
1019 struct s390_cpumsf_queue *sfq = (struct s390_cpumsf_queue *) in s390_cpumsf_free_queues() local
1022 if (sfq != NULL) { in s390_cpumsf_free_queues()
1023 if (sfq->logfile) { in s390_cpumsf_free_queues()
1024 fclose(sfq->logfile); in s390_cpumsf_free_queues()
1025 sfq->logfile = NULL; in s390_cpumsf_free_queues()
1027 if (sfq->logfile_ctr) { in s390_cpumsf_free_queues()
1028 fclose(sfq->logfile_ctr); in s390_cpumsf_free_queues()
1029 sfq->logfile_ctr = NULL; in s390_cpumsf_free_queues()