Lines Matching refs:cs
432 static int ctf_stream__flush(struct ctf_stream *cs) in ctf_stream__flush() argument
436 if (cs) { in ctf_stream__flush()
437 err = bt_ctf_stream_flush(cs->stream); in ctf_stream__flush()
439 pr_err("CTF stream %d flush failed\n", cs->cpu); in ctf_stream__flush()
442 cs->cpu, cs->count); in ctf_stream__flush()
444 cs->count = 0; in ctf_stream__flush()
452 struct ctf_stream *cs; in ctf_stream__create() local
458 cs = zalloc(sizeof(*cs)); in ctf_stream__create()
459 if (!cs) { in ctf_stream__create()
491 cs->cpu = cpu; in ctf_stream__create()
492 cs->stream = stream; in ctf_stream__create()
493 return cs; in ctf_stream__create()
501 free(cs); in ctf_stream__create()
505 static void ctf_stream__delete(struct ctf_stream *cs) in ctf_stream__delete() argument
507 if (cs) { in ctf_stream__delete()
508 bt_ctf_stream_put(cs->stream); in ctf_stream__delete()
509 free(cs); in ctf_stream__delete()
515 struct ctf_stream *cs = cw->stream[cpu]; in ctf_stream() local
517 if (!cs) { in ctf_stream()
518 cs = ctf_stream__create(cw, cpu); in ctf_stream()
519 cw->stream[cpu] = cs; in ctf_stream()
522 return cs; in ctf_stream()
550 static bool is_flush_needed(struct ctf_stream *cs) in is_flush_needed() argument
552 return cs->count >= STREAM_FLUSH_COUNT; in is_flush_needed()
564 struct ctf_stream *cs; in process_sample_event() local
599 cs = ctf_stream(cw, get_sample_cpu(cw, sample, evsel)); in process_sample_event()
600 if (cs) { in process_sample_event()
601 if (is_flush_needed(cs)) in process_sample_event()
602 ctf_stream__flush(cs); in process_sample_event()
604 cs->count++; in process_sample_event()
605 bt_ctf_stream_append_event(cs->stream, event); in process_sample_event()
609 return cs ? 0 : -1; in process_sample_event()