#include <assert.h>
#include <string.h>
#include <stdio.h>
+#include <inttypes.h>
//#include <pango/pango.h>
static gint background_ready(void *hook_data, void *call_data)
{
ControlFlowData *resourceview_data = (ControlFlowData *)hook_data;
- LttvTrace *trace = (LttvTrace*)call_data;
resourceview_data->background_info_waiting--;
return 0;
}
+int before_execmode_hook_irq(void *hook_data, void *call_data);
+int before_execmode_hook_soft_irq(void *hook_data, void *call_data);
+int before_execmode_hook_trap(void *hook_data, void *call_data);
+
/* before_execmode_hook
*
* This function basically draw lines and icons. Two types of lines are drawn :
LttvTracefileState *tfs = (LttvTracefileState *)call_data;
LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
+ struct marker_info *minfo;
LttEvent *e;
e = ltt_tracefile_get_event(tfc->tf);
guint64 irq;
guint cpu = tfs->cpu;
- guint16 ev_id_entry = marker_get_id_from_info(trace, marker_get_info_from_name(trace, lttv_merge_facility_event_name(LTT_FACILITY_KERNEL, LTT_EVENT_IRQ_ENTRY)));
- guint16 ev_id_exit = marker_get_id_from_info(trace, marker_get_info_from_name(trace, lttv_merge_facility_event_name(LTT_FACILITY_KERNEL, LTT_EVENT_IRQ_EXIT)));
- if(ev_id_entry == e->event_id) {
+ /*
+ * Check for LTT_CHANNEL_KERNEL channel name and event ID
+ * corresponding to LTT_EVENT_IRQ_ENTRY or LTT_EVENT_IRQ_EXIT.
+ */
+ if (tfc->tf->name != LTT_CHANNEL_KERNEL)
+ return 0;
+ minfo = marker_get_info_from_id(tfc->tf->mdata, e->event_id);
+ g_assert(minfo != NULL);
+ if (minfo->name == LTT_EVENT_IRQ_ENTRY) {
irq = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));
- }
- else if(ev_id_exit == e->event_id) {
+ } else if (minfo->name == LTT_EVENT_IRQ_EXIT) {
irq = ts->cpu_states[cpu].last_irq;
- }
- else {
+ } else
return 0;
- }
guint trace_num = ts->parent.index;
GQuark name;
{
gchar *str;
- str = g_strdup_printf("IRQ %llu [%s]", irq, (char*)g_quark_to_string(ts->irq_names[irq]));
+ str = g_strdup_printf("IRQ %" PRIu64 " [%s]", irq, (char*)g_quark_to_string(ts->irq_names[irq]));
name = g_quark_from_string(str);
g_free(str);
}
LttvTracefileState *tfs = (LttvTracefileState *)call_data;
LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
+ struct marker_info *minfo;
LttEvent *e;
e = ltt_tracefile_get_event(tfc->tf);
guint64 softirq;
guint cpu = tfs->cpu;
- guint16 ev_id_raise = marker_get_id_from_info(trace, marker_get_info_from_name(trace, lttv_merge_facility_event_name(LTT_FACILITY_KERNEL, LTT_EVENT_SOFT_IRQ_RAISE)));
- guint16 ev_id_entry = marker_get_id_from_info(trace, marker_get_info_from_name(trace, lttv_merge_facility_event_name(LTT_FACILITY_KERNEL, LTT_EVENT_SOFT_IRQ_ENTRY)));
- guint16 ev_id_exit = marker_get_id_from_info(trace, marker_get_info_from_name(trace, lttv_merge_facility_event_name(LTT_FACILITY_KERNEL, LTT_EVENT_SOFT_IRQ_EXIT)));
- if(ev_id_entry == e->event_id || ev_id_raise == e->event_id) {
+ /*
+ * Check for LTT_CHANNEL_KERNEL channel name and event ID
+ * corresponding to LTT_EVENT_SOFT_IRQ_RAISE, LTT_EVENT_SOFT_IRQ_ENTRY
+ * or LTT_EVENT_SOFT_IRQ_EXIT.
+ */
+ if (tfc->tf->name != LTT_CHANNEL_KERNEL)
+ return 0;
+ minfo = marker_get_info_from_id(tfc->tf->mdata, e->event_id);
+ g_assert(minfo != NULL);
+ if (minfo->name == LTT_EVENT_SOFT_IRQ_RAISE
+ || minfo->name == LTT_EVENT_SOFT_IRQ_ENTRY) {
softirq = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));
- }
- else if(ev_id_exit == e->event_id) {
+ } else if (minfo->name == LTT_EVENT_SOFT_IRQ_EXIT) {
softirq = ts->cpu_states[cpu].last_soft_irq;
- }
- else {
+ } else
return 0;
- }
guint trace_num = ts->parent.index;
LttvTracefileState *tfs = (LttvTracefileState *)call_data;
LttvTraceState *ts = (LttvTraceState *)tfc->t_context;
+ struct marker_info *minfo;
LttEvent *e;
e = ltt_tracefile_get_event(tfc->tf);
guint64 trap;
guint cpu = tfs->cpu;
- guint16 ev_id_entry = marker_get_id_from_info(trace, marker_get_info_from_name(trace, lttv_merge_facility_event_name(LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_TRAP_ENTRY)));
- guint16 ev_id_exit = marker_get_id_from_info(trace, marker_get_info_from_name(trace, lttv_merge_facility_event_name(LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_TRAP_EXIT)));
- if(ev_id_entry == e->event_id) {
+ /*
+ * Check for LTT_CHANNEL_KERNEL channel name and event ID
+ * corresponding to LTT_EVENT_TRAP/PAGE_FAULT_ENTRY or
+ * LTT_EVENT_TRAP/PAGE_FAULT_EXIT.
+ */
+ if (tfc->tf->name != LTT_CHANNEL_KERNEL)
+ return 0;
+ minfo = marker_get_info_from_id(tfc->tf->mdata, e->event_id);
+ g_assert(minfo != NULL);
+ if (minfo->name == LTT_EVENT_TRAP_ENTRY
+ || minfo->name == LTT_EVENT_PAGE_FAULT_ENTRY
+ || minfo->name == LTT_EVENT_PAGE_FAULT_NOSEM_ENTRY) {
trap = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));
- }
- else if(ev_id_exit == e->event_id) {
+ } else if (minfo->name == LTT_EVENT_TRAP_EXIT
+ || minfo->name == LTT_EVENT_PAGE_FAULT_EXIT
+ || minfo->name == LTT_EVENT_PAGE_FAULT_NOSEM_EXIT) {
trap = ts->cpu_states[cpu].last_trap;
- }
- else {
+ /* Handle case where a trace starts with a trap exit event */
+ if (trap == -1)
+ return 0;
+ } else
return 0;
- }
guint trace_num = ts->parent.index;
guint nb_trace = lttv_traceset_number(traceset);
/* Only execute when called for the first trace's events request */
- if(!process_list->current_hash_data) return;
+ if(!process_list->current_hash_data)
+ return 0;
for(i = 0 ; i < nb_trace ; i++) {
g_free(process_list->current_hash_data[i]);