Fix eventview trap handling
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 15 May 2009 12:33:59 +0000 (12:33 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 15 May 2009 12:33:59 +0000 (12:33 +0000)
commit86f3d84b4d12bc599df8dca2cc8d954746d67942
tree89636f1f8796a7f697645e858effd1170b448dde
parent66cc2cb3c7a0a3ad749b2bef6f38664c8d666397
Fix eventview trap handling

And here is the offending code :

eventhooks.c :

int before_execmode_hook_trap(void *hook_data, void *call_data)

  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 (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
    return 0;

  guint trace_num = ts->parent.index;

  /* Well, the process_out existed : we must get it in the process hash
   * or add it, and draw its items.
   */
   /* Add process to process list (if not present) */
  guint pl_height = 0;
  HashedResourceData *hashed_process_data = NULL;
  ProcessList *process_list = resourceview_data->process_list;

  hashed_process_data = resourcelist_obtain_trap(resourceview_data, trace_num, trap);

we end up calling resourcelist_obtain_trap() with a trap id of 0.

I bet the trace first has a trap exit event, without any prior trap
entry. Therefore, the last_trap is probably set to -1, which is used as
trap id.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
git-svn-id: http://ltt.polymtl.ca/svn@3380 04897980-b3bd-0310-b5e0-8ef037075253
trunk/lttv/lttv/modules/gui/resourceview/eventhooks.c
trunk/lttv/lttv/modules/gui/resourceview/processlist.c
This page took 0.02397 seconds and 4 git commands to generate.