#include <stdio.h>
#include <string.h>
#include <ltt/ltt-private.h>
+#include <inttypes.h>
/* Comment :
* Mathieu Desnoyers
GQuark
LTT_EVENT_SYSCALL_ENTRY,
LTT_EVENT_SYSCALL_EXIT,
+ LTT_EVENT_PAGE_FAULT_NOSEM_ENTRY,
+ LTT_EVENT_PAGE_FAULT_NOSEM_EXIT,
+ LTT_EVENT_PAGE_FAULT_ENTRY,
+ LTT_EVENT_PAGE_FAULT_EXIT,
LTT_EVENT_TRAP_ENTRY,
LTT_EVENT_TRAP_EXIT,
LTT_EVENT_IRQ_ENTRY,
/* It's a Usertrace */
guint tid = ltt_tracefile_tid(tfcs->parent.tf);
GTree *usertrace_tree = (GTree*)g_hash_table_lookup(tcs->usertraces,
- (gconstpointer)tid);
+ GUINT_TO_POINTER(tid));
if(!usertrace_tree) {
usertrace_tree = g_tree_new_full(compare_usertraces,
NULL, free_usertrace_key, NULL);
g_hash_table_insert(tcs->usertraces,
- (gpointer)tid, usertrace_tree);
+ GUINT_TO_POINTER(tid), usertrace_tree);
}
LttTime *timestamp = g_new(LttTime, 1);
*timestamp = ltt_interpolate_time_from_tsc(tfcs->parent.tf,
for(i = 0 ; i < process->user_stack->len; i++) {
address = g_array_index(process->user_stack, guint64, i);
- fprintf(fp, " <USER_STACK ADDRESS=\"%llu\"/>\n",
+ fprintf(fp, " <USER_STACK ADDRESS=\"%" PRIu64 "\"/>\n",
address);
}
else {
ltt_event_position(e, ep);
ltt_event_position_get(ep, &tf, &nb_block, &offset, &tsc);
- fprintf(fp, " BLOCK=%u OFFSET=%u TSC=%llu/>\n", nb_block, offset,
+ fprintf(fp, " BLOCK=%u OFFSET=%u TSC=%" PRIu64 "/>\n", nb_block, offset,
tsc);
}
}
guint64 tsc;
LttTracefile *tf;
ltt_event_position_get(ep, &tf, &nb_block, &offset, &tsc);
- g_info("Block %u offset %u tsc %llu time %lu.%lu", nb_block, offset,
+ g_info("Block %u offset %u tsc %" PRIu64 " time %lu.%lu", nb_block, offset,
tsc,
tfcs->parent.timestamp.tv_sec, tfcs->parent.timestamp.tv_nsec);
}
* timestamp the lowest, but higher or equal to "timestamp". */
res.time = timestamp;
res.best = NULL;
- GTree *usertrace_tree = g_hash_table_lookup(tcs->usertraces, (gpointer)pid);
+ GTree *usertrace_tree = g_hash_table_lookup(tcs->usertraces,
+ GUINT_TO_POINTER(pid));
if(usertrace_tree) {
g_tree_search(usertrace_tree, search_usertrace, &res);
if(res.best)
} else {
/* Fixup an incomplete irq table */
GString *string = g_string_new("");
- g_string_printf(string, "softirq %llu", softirq);
+ g_string_printf(string, "softirq %" PRIu64, softirq);
submode = g_quark_from_string(string->str);
g_string_free(string, TRUE);
}
if(process->current_function != funcptr){
g_info("Different functions (%lu.%09lu): ignore it\n",
tfs->parent.timestamp.tv_sec, tfs->parent.timestamp.tv_nsec);
- g_info("process state has %llu when pop_function is %llu\n",
+ g_info("process state has %" PRIu64 " when pop_function is %" PRIu64 "\n",
process->current_function, funcptr);
g_info("{ %u, %u, %s, %s, %s }\n",
process->pid,
NULL,
trap_exit, NULL, &hooks);
+ lttv_trace_find_hook(ts->parent.t,
+ LTT_CHANNEL_KERNEL,
+ LTT_EVENT_PAGE_FAULT_ENTRY,
+ FIELD_ARRAY(LTT_FIELD_TRAP_ID),
+ trap_entry, NULL, &hooks);
+
+ lttv_trace_find_hook(ts->parent.t,
+ LTT_CHANNEL_KERNEL,
+ LTT_EVENT_PAGE_FAULT_EXIT,
+ NULL,
+ trap_exit, NULL, &hooks);
+
+ lttv_trace_find_hook(ts->parent.t,
+ LTT_CHANNEL_KERNEL,
+ LTT_EVENT_PAGE_FAULT_NOSEM_ENTRY,
+ FIELD_ARRAY(LTT_FIELD_TRAP_ID),
+ trap_entry, NULL, &hooks);
+
+ lttv_trace_find_hook(ts->parent.t,
+ LTT_CHANNEL_KERNEL,
+ LTT_EVENT_PAGE_FAULT_NOSEM_EXIT,
+ NULL,
+ trap_exit, NULL, &hooks);
+
lttv_trace_find_hook(ts->parent.t,
LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_ENTRY,
gboolean is_named;
- LttvAttribute *saved_states_tree, *saved_state_tree, *closest_tree;
+ LttvAttribute *saved_states_tree, *saved_state_tree, *closest_tree = NULL;
//g_tree_destroy(self->parent.pqueue);
//self->parent.pqueue = g_tree_new(compare_tracefile);
LTT_EVENT_SYSCALL_EXIT = g_quark_from_string("syscall_exit");
LTT_EVENT_TRAP_ENTRY = g_quark_from_string("trap_entry");
LTT_EVENT_TRAP_EXIT = g_quark_from_string("trap_exit");
+ LTT_EVENT_PAGE_FAULT_ENTRY = g_quark_from_string("page_fault_entry");
+ LTT_EVENT_PAGE_FAULT_EXIT = g_quark_from_string("page_fault_exit");
+ LTT_EVENT_PAGE_FAULT_NOSEM_ENTRY = g_quark_from_string("page_fault_nosem_entry");
+ LTT_EVENT_PAGE_FAULT_NOSEM_EXIT = g_quark_from_string("page_fault_nosem_exit");
LTT_EVENT_IRQ_ENTRY = g_quark_from_string("irq_entry");
LTT_EVENT_IRQ_EXIT = g_quark_from_string("irq_exit");
LTT_EVENT_SOFT_IRQ_RAISE = g_quark_from_string("softirq_raise");