Lines Matching refs:tevent
204 struct trace_events *tevent = events; in trace_events_free() local
207 while (tevent) { in trace_events_free()
208 free_event = tevent; in trace_events_free()
210 tevent = tevent->next; in trace_events_free()
226 struct trace_events *tevent; in trace_event_alloc() local
228 tevent = calloc(1, sizeof(*tevent)); in trace_event_alloc()
229 if (!tevent) in trace_event_alloc()
232 tevent->system = strdup(event_string); in trace_event_alloc()
233 if (!tevent->system) { in trace_event_alloc()
234 free(tevent); in trace_event_alloc()
238 tevent->event = strstr(tevent->system, ":"); in trace_event_alloc()
239 if (tevent->event) { in trace_event_alloc()
240 *tevent->event = '\0'; in trace_event_alloc()
241 tevent->event = &tevent->event[1]; in trace_event_alloc()
244 return tevent; in trace_event_alloc()
281 struct trace_events *tevent) in trace_event_disable_filter() argument
286 if (!tevent->filter) in trace_event_disable_filter()
289 if (!tevent->filter_enabled) in trace_event_disable_filter()
292 debug_msg("Disabling %s:%s filter %s\n", tevent->system, in trace_event_disable_filter()
293 tevent->event ? : "*", tevent->filter); in trace_event_disable_filter()
295 snprintf(filter, 1024, "!%s\n", tevent->filter); in trace_event_disable_filter()
297 retval = tracefs_event_file_write(instance->inst, tevent->system, in trace_event_disable_filter()
298 tevent->event, "filter", filter); in trace_event_disable_filter()
300 err_msg("Error disabling %s:%s filter %s\n", tevent->system, in trace_event_disable_filter()
301 tevent->event ? : "*", tevent->filter); in trace_event_disable_filter()
310 struct trace_events *tevent) in trace_event_save_hist() argument
317 if (!tevent) in trace_event_save_hist()
321 if (!tevent->trigger) in trace_event_save_hist()
325 retval = strncmp(tevent->trigger, "hist:", strlen("hist:")); in trace_event_save_hist()
329 snprintf(path, 1024, "%s_%s_hist.txt", tevent->system, tevent->event); in trace_event_save_hist()
331 printf(" Saving event %s:%s hist to %s\n", tevent->system, tevent->event, path); in trace_event_save_hist()
339 hist = tracefs_event_file_read(instance->inst, tevent->system, tevent->event, "hist", 0); in trace_event_save_hist()
341 err_msg(" Failed to read %s:%s hist file\n", tevent->system, tevent->event); in trace_event_save_hist()
359 struct trace_events *tevent) in trace_event_disable_trigger() argument
364 if (!tevent->trigger) in trace_event_disable_trigger()
367 if (!tevent->trigger_enabled) in trace_event_disable_trigger()
370 debug_msg("Disabling %s:%s trigger %s\n", tevent->system, in trace_event_disable_trigger()
371 tevent->event ? : "*", tevent->trigger); in trace_event_disable_trigger()
373 trace_event_save_hist(instance, tevent); in trace_event_disable_trigger()
375 snprintf(trigger, 1024, "!%s\n", tevent->trigger); in trace_event_disable_trigger()
377 retval = tracefs_event_file_write(instance->inst, tevent->system, in trace_event_disable_trigger()
378 tevent->event, "trigger", trigger); in trace_event_disable_trigger()
380 err_msg("Error disabling %s:%s trigger %s\n", tevent->system, in trace_event_disable_trigger()
381 tevent->event ? : "*", tevent->trigger); in trace_event_disable_trigger()
390 struct trace_events *tevent = events; in trace_events_disable() local
395 while (tevent) { in trace_events_disable()
396 debug_msg("Disabling event %s:%s\n", tevent->system, tevent->event ? : "*"); in trace_events_disable()
397 if (tevent->enabled) { in trace_events_disable()
398 trace_event_disable_filter(instance, tevent); in trace_events_disable()
399 trace_event_disable_trigger(instance, tevent); in trace_events_disable()
400 tracefs_event_disable(instance->inst, tevent->system, tevent->event); in trace_events_disable()
403 tevent->enabled = 0; in trace_events_disable()
404 tevent = tevent->next; in trace_events_disable()
412 struct trace_events *tevent) in trace_event_enable_filter() argument
417 if (!tevent->filter) in trace_event_enable_filter()
420 if (!tevent->event) { in trace_event_enable_filter()
422 tevent->filter, tevent->system); in trace_event_enable_filter()
426 snprintf(filter, 1024, "%s\n", tevent->filter); in trace_event_enable_filter()
428 debug_msg("Enabling %s:%s filter %s\n", tevent->system, in trace_event_enable_filter()
429 tevent->event ? : "*", tevent->filter); in trace_event_enable_filter()
431 retval = tracefs_event_file_write(instance->inst, tevent->system, in trace_event_enable_filter()
432 tevent->event, "filter", filter); in trace_event_enable_filter()
434 err_msg("Error enabling %s:%s filter %s\n", tevent->system, in trace_event_enable_filter()
435 tevent->event ? : "*", tevent->filter); in trace_event_enable_filter()
439 tevent->filter_enabled = 1; in trace_event_enable_filter()
447 struct trace_events *tevent) in trace_event_enable_trigger() argument
452 if (!tevent->trigger) in trace_event_enable_trigger()
455 if (!tevent->event) { in trace_event_enable_trigger()
457 tevent->trigger, tevent->system); in trace_event_enable_trigger()
461 snprintf(trigger, 1024, "%s\n", tevent->trigger); in trace_event_enable_trigger()
463 debug_msg("Enabling %s:%s trigger %s\n", tevent->system, in trace_event_enable_trigger()
464 tevent->event ? : "*", tevent->trigger); in trace_event_enable_trigger()
466 retval = tracefs_event_file_write(instance->inst, tevent->system, in trace_event_enable_trigger()
467 tevent->event, "trigger", trigger); in trace_event_enable_trigger()
469 err_msg("Error enabling %s:%s trigger %s\n", tevent->system, in trace_event_enable_trigger()
470 tevent->event ? : "*", tevent->trigger); in trace_event_enable_trigger()
474 tevent->trigger_enabled = 1; in trace_event_enable_trigger()
485 struct trace_events *tevent = events; in trace_events_enable() local
488 while (tevent) { in trace_events_enable()
489 debug_msg("Enabling event %s:%s\n", tevent->system, tevent->event ? : "*"); in trace_events_enable()
490 retval = tracefs_event_enable(instance->inst, tevent->system, tevent->event); in trace_events_enable()
492 err_msg("Error enabling event %s:%s\n", tevent->system, in trace_events_enable()
493 tevent->event ? : "*"); in trace_events_enable()
497 retval = trace_event_enable_filter(instance, tevent); in trace_events_enable()
501 retval = trace_event_enable_trigger(instance, tevent); in trace_events_enable()
505 tevent->enabled = 1; in trace_events_enable()
506 tevent = tevent->next; in trace_events_enable()