Lines Matching refs:print_state
32 struct print_state { struct
67 struct print_state *print_state = ps; in default_print_start() argument
69 if (!print_state->name_only && pager_in_use()) in default_print_start()
73 static void default_print_end(void *print_state __maybe_unused) {} in default_print_end()
105 struct print_state *print_state = ps; in default_print_event() local
108 if (deprecated && !print_state->deprecated) in default_print_event()
111 if (print_state->pmu_glob && pmu_name && !strglobmatch(pmu_name, print_state->pmu_glob)) in default_print_event()
114 if (print_state->event_glob && in default_print_event()
115 (!event_name || !strglobmatch(event_name, print_state->event_glob)) && in default_print_event()
116 (!event_alias || !strglobmatch(event_alias, print_state->event_glob)) && in default_print_event()
117 (!topic || !strglobmatch_nocase(topic, print_state->event_glob))) in default_print_event()
120 if (print_state->name_only) { in default_print_event()
128 if (strcmp(print_state->last_topic, topic ?: "")) { in default_print_event()
131 zfree(&print_state->last_topic); in default_print_event()
132 print_state->last_topic = strdup(topic ?: ""); in default_print_event()
147 if (desc && print_state->desc) { in default_print_event()
164 if (long_desc && print_state->long_desc) { in default_print_event()
170 if (print_state->detailed && encoding_desc) { in default_print_event()
186 struct print_state *print_state = ps; in default_print_metric() local
188 if (print_state->event_glob && in default_print_metric()
189 (!print_state->metrics || !name || !strglobmatch(name, print_state->event_glob)) && in default_print_metric()
190 (!print_state->metricgroups || !group || !strglobmatch(group, print_state->event_glob))) in default_print_metric()
193 if (!print_state->name_only && !print_state->last_metricgroups) { in default_print_metric()
194 if (print_state->metricgroups) { in default_print_metric()
196 if (!print_state->metrics) in default_print_metric()
202 if (!print_state->last_metricgroups || in default_print_metric()
203 strcmp(print_state->last_metricgroups, group ?: "")) { in default_print_metric()
204 if (group && print_state->metricgroups) { in default_print_metric()
205 if (print_state->name_only) in default_print_metric()
207 else if (print_state->metrics) { in default_print_metric()
217 zfree(&print_state->last_metricgroups); in default_print_metric()
218 print_state->last_metricgroups = strdup(group ?: ""); in default_print_metric()
220 if (!print_state->metrics) in default_print_metric()
223 if (print_state->name_only) { in default_print_metric()
224 if (print_state->metrics && in default_print_metric()
225 !strlist__has_entry(print_state->visited_metrics, name)) { in default_print_metric()
227 strlist__add(print_state->visited_metrics, name); in default_print_metric()
233 if (desc && print_state->desc) { in default_print_metric()
238 if (long_desc && print_state->long_desc) { in default_print_metric()
243 if (expr && print_state->detailed) { in default_print_metric()
248 if (threshold && print_state->detailed) { in default_print_metric()
260 static void json_print_start(void *print_state __maybe_unused) in json_print_start()
267 struct json_print_state *print_state = ps; in json_print_end() local
269 printf("%s]\n", print_state->need_sep ? "\n" : ""); in json_print_end()
331 struct json_print_state *print_state = ps; in json_print_event() local
336 printf("%s{\n", print_state->need_sep ? ",\n" : ""); in json_print_event()
337 print_state->need_sep = true; in json_print_event()
395 struct json_print_state *print_state = ps; in json_print_metric() local
400 printf("%s{\n", print_state->need_sep ? ",\n" : ""); in json_print_metric()
401 print_state->need_sep = true; in json_print_metric()
439 struct print_state *print_state = ps; in default_skip_duplicate_pmus() local
441 return !print_state->long_desc; in default_skip_duplicate_pmus()
447 struct print_state default_ps = {}; in cmd_list()
448 struct print_state json_ps = {}; in cmd_list()