#include <ctype.h>
#include <ltt/ltt-private.h>
#include <string.h>
+#include <inttypes.h>
static inline void print_enum_events(LttEvent *e, struct marker_field *f,
guint64 value, GString *s, LttvTracefileState *tfs)
{
- struct marker_info *info = marker_get_info_from_id(tfs->parent.tf->mdata,
- e->event_id);
+ LttTracefile *tf = tfs->parent.tf;
+ struct marker_info *info = marker_get_info_from_id(tf->mdata, e->event_id);
LttvTraceState *ts = (LttvTraceState*)(tfs->parent.t_context);
- //TODO optimize with old quarks.
- if (info->name == g_quark_from_static_string("kernel_syscall_entry") &&
- f->name == LTT_FIELD_SYSCALL_ID) {
- g_string_append_printf(s, " [%s]",
- g_quark_to_string(ts->syscall_names[value]));
- } else if ((info->name == g_quark_from_static_string("kernel_softirq_entry")
- || info->name == g_quark_from_static_string("kernel_softirq_exit")
- || info->name == g_quark_from_static_string("kernel_softirq_raise")) &&
- f->name == g_quark_from_static_string("softirq_id")) {
- g_string_append_printf(s, " [%s]",
- g_quark_to_string(ts->soft_irq_names[value]));
+ if (tf->name == LTT_CHANNEL_KERNEL) {
+ if (info->name == LTT_EVENT_SYSCALL_ENTRY
+ && f->name == LTT_FIELD_SYSCALL_ID) {
+ g_string_append_printf(s, " [%s]",
+ g_quark_to_string(ts->syscall_names[value]));
+ } else if ((info->name == LTT_EVENT_SOFT_IRQ_ENTRY
+ || info->name == LTT_EVENT_SOFT_IRQ_EXIT
+ || info->name == LTT_EVENT_SOFT_IRQ_RAISE)
+ && f->name == LTT_FIELD_SOFT_IRQ_ID) {
+ g_string_append_printf(s, " [%s]",
+ g_quark_to_string(ts->soft_irq_names[value]));
+ } else if (info->name == LTT_EVENT_KPROBE
+ && f->name == LTT_FIELD_IP) {
+ GQuark symbol = g_hash_table_lookup(ts->kprobe_hash,
+ (gconstpointer)value);
+ if (symbol)
+ g_string_append_printf(s, " [%s]", g_quark_to_string(symbol));
+ }
}
-
}
void lttv_print_field(LttEvent *e, struct marker_field *f, GString *s,
if(name)
g_string_append_printf(s, "%s = ", g_quark_to_string(name));
}
- g_string_append_printf(s, "0x%llx", ltt_event_get_long_unsigned(e,f));
+ g_string_append_printf(s, "0x%" PRIx64, ltt_event_get_long_unsigned(e,f));
//g_string_append_printf(s, type->fmt, ltt_event_get_long_unsigned(e,f));
break;
if(mandatory_fields) {
time = ltt_event_time(e);
- g_string_append_printf(s,"%s: %ld.%09ld (%s%s_%u)",
+ g_string_append_printf(s,"%s.%s: %ld.%09ld (%s/%s_%u)",
+ g_quark_to_string(ltt_tracefile_name(tfs->parent.tf)),
g_quark_to_string(info->name),
(long)time.tv_sec, time.tv_nsec,
g_quark_to_string(
g_quark_to_string(ltt_tracefile_name(tfs->parent.tf)),
cpu);
/* Print the process id and the state/interrupt type of the process */
- g_string_append_printf(s,", %u, %u, %s, %s, %u, 0x%llX, %s", process->pid,
- process->tgid,
- g_quark_to_string(process->name),
- g_quark_to_string(process->brand),
- process->ppid, process->current_function,
- g_quark_to_string(process->state->t));
+ g_string_append_printf(s,", %u, %u, %s, %s, %u, 0x%" PRIx64", %s",
+ process->pid,
+ process->tgid,
+ g_quark_to_string(process->name),
+ g_quark_to_string(process->brand),
+ process->ppid, process->current_function,
+ g_quark_to_string(process->state->t));
}
if(marker_get_num_fields(info) == 0) return;