Lines Matching refs:cs
673 static int ctf_stream__flush(struct ctf_stream *cs) in ctf_stream__flush() argument
677 if (cs) { in ctf_stream__flush()
678 err = bt_ctf_stream_flush(cs->stream); in ctf_stream__flush()
680 pr_err("CTF stream %d flush failed\n", cs->cpu); in ctf_stream__flush()
683 cs->cpu, cs->count); in ctf_stream__flush()
685 cs->count = 0; in ctf_stream__flush()
693 struct ctf_stream *cs; in ctf_stream__create() local
699 cs = zalloc(sizeof(*cs)); in ctf_stream__create()
700 if (!cs) { in ctf_stream__create()
732 cs->cpu = cpu; in ctf_stream__create()
733 cs->stream = stream; in ctf_stream__create()
734 return cs; in ctf_stream__create()
742 free(cs); in ctf_stream__create()
746 static void ctf_stream__delete(struct ctf_stream *cs) in ctf_stream__delete() argument
748 if (cs) { in ctf_stream__delete()
749 bt_ctf_stream_put(cs->stream); in ctf_stream__delete()
750 free(cs); in ctf_stream__delete()
756 struct ctf_stream *cs = cw->stream[cpu]; in ctf_stream() local
758 if (!cs) { in ctf_stream()
759 cs = ctf_stream__create(cw, cpu); in ctf_stream()
760 cw->stream[cpu] = cs; in ctf_stream()
763 return cs; in ctf_stream()
791 static bool is_flush_needed(struct ctf_stream *cs) in is_flush_needed() argument
793 return cs->count >= STREAM_FLUSH_COUNT; in is_flush_needed()
805 struct ctf_stream *cs; in process_sample_event() local
854 cs = ctf_stream(cw, get_sample_cpu(cw, sample, evsel)); in process_sample_event()
855 if (cs) { in process_sample_event()
856 if (is_flush_needed(cs)) in process_sample_event()
857 ctf_stream__flush(cs); in process_sample_event()
859 cs->count++; in process_sample_event()
860 bt_ctf_stream_append_event(cs->stream, event); in process_sample_event()
864 return cs ? 0 : -1; in process_sample_event()
884 struct ctf_stream *cs; \
897 cs = ctf_stream(cw, 0); \
898 if (cs) { \
899 if (is_flush_needed(cs)) \
900 ctf_stream__flush(cs); \
902 cs->count++; \
903 bt_ctf_stream_append_event(cs->stream, event); \