* MA 02111-1307, USA.
*/
+#define _GNU_SOURCE
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <lttv/lttv.h>
#include <lttv/module.h>
#include <lttv/state.h>
-#include <ltt/facility.h>
#include <ltt/trace.h>
#include <ltt/event.h>
-#include <ltt/type.h>
#include <stdio.h>
#include <string.h>
LTT_EVENT_FUNCTION_EXIT,
LTT_EVENT_THREAD_BRAND,
LTT_EVENT_REQUEST_ISSUE,
- LTT_EVENT_REQUEST_COMPLETE;
+ LTT_EVENT_REQUEST_COMPLETE,
+ LTT_EVENT_LIST_INTERRUPT;
/* Fields Quarks */
LTT_FIELD_CALL_SITE,
LTT_FIELD_MINOR,
LTT_FIELD_MAJOR,
- LTT_FIELD_OPERATION;
+ LTT_FIELD_OPERATION,
+ LTT_FIELD_ACTION,
+ LTT_FIELD_NUM;
LttvExecutionMode
LTTV_STATE_MODE_UNKNOWN,
{
guint i, nb_cpus, nb_irqs;
- LttvTracefileState *tfcs;
+ //LttvTracefileState *tfcs;
LttTime start_time, end_time;
{
FILE *fp;
GPtrArray *quarktable;
- char *trace_path;
+ const char *trace_path;
char path[PATH_MAX];
guint count;
guint i;
LttvTraceState *tcs;
- LttvTracefileState *tfcs;
+ //LttvTracefileState *tfcs;
LttvAttributeValue v;
}
for(i = 0 ; i < process->user_stack->len; i++) {
- address = &g_array_index(process->user_stack, guint64, i);
+ address = g_array_index(process->user_stack, guint64, i);
fprintf(fp, " <USER_STACK ADDRESS=\"%llu\"/>\n",
address);
}
}
for(i = 0 ; i < process->user_stack->len; i++) {
- address = &g_array_index(process->user_stack, guint64, i);
+ address = g_array_index(process->user_stack, guint64, i);
fputc(HDR_USER_STACK, fp);
fwrite(&address, sizeof(address), 1, fp);
#if 0
LttvProcessState tmp;
GQuark tmpq;
- guint i;
guint64 *address;
- guint cpu;
/* TODO : check return value */
fread(&tmp.type, sizeof(tmp.type), 1, fp);
end_loop:
*(tcs->max_time_state_recomputed_in_seek) = tcs->parent.time_span.end_time;
restore_init_state(tcs);
- lttv_process_trace_seek_time(tcs, ltt_time_zero);
+ lttv_process_trace_seek_time(&tcs->parent, ltt_time_zero);
return;
}
static void insert_and_copy_bdev_state(gpointer k, gpointer v, gpointer u)
{
- GHashTable *ht = (GHashTable *)u;
+ //GHashTable *ht = (GHashTable *)u;
LttvBdevState *bds = (LttvBdevState *)v;
LttvBdevState *newbds;
- newbds = bdevstate_copy(v);
+ newbds = bdevstate_copy(bds);
g_hash_table_insert(u, k, newbds);
}
guint *running_process;
- LttvAttributeType type;
-
LttvAttributeValue value;
- LttvAttributeName name;
-
LttEventPosition *ep;
tracefiles_tree = lttv_attribute_find_subdir(container,
/* save the cpu state */
{
- guint size = sizeof(LttvCPUState)*nb_cpus;
value = lttv_attribute_add(container, LTTV_STATE_RESOURCE_CPUS,
LTTV_POINTER);
*(value.v_pointer) = lttv_state_copy_cpu_states(self->cpu_states, nb_cpus);
/* save the irq state */
nb_irqs = self->nb_irqs;
{
- guint size = sizeof(LttvCPUState)*nb_irqs;
value = lttv_attribute_add(container, LTTV_STATE_RESOURCE_IRQS,
LTTV_POINTER);
*(value.v_pointer) = lttv_state_copy_irq_states(self->irq_states, nb_irqs);
gboolean is_named;
- LttEventPosition *ep;
-
tracefiles_tree = lttv_attribute_find_subdir(container,
LTTV_STATE_TRACEFILES);
g_object_ref(G_OBJECT(tracefiles_tree));
}
#endif //0
if(!lttv_trace_find_hook(tcs->parent.t,
- LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY,
+ LTT_EVENT_SYSCALL_ENTRY,
LTT_FIELD_SYSCALL_ID, 0, 0,
NULL, NULL, &h)) {
return FALSE;
}
+static gboolean enum_interrupt(void *hook_data, void *call_data)
+{
+ LttvTracefileState *s = (LttvTracefileState *)call_data;
+ LttvTraceState *ts = (LttvTraceState *)s->parent.t_context;
+ LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
+ guint8 fac_id = ltt_event_facility_id(e);
+ guint8 ev_id = ltt_event_eventtype_id(e);
+ LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data;
+
+ GQuark action = g_quark_from_string(ltt_event_get_string(e, thf->f1));
+ guint irq = ltt_event_get_long_unsigned(e, thf->f2);
+
+ ts->irq_names[irq] = action;
+
+ return FALSE;
+}
+
+
static gboolean bdev_request_issue(void *hook_data, void *call_data)
{
LttvTracefileState *s = (LttvTracefileState *)call_data;
statedump_end, NULL, &g_array_index(hooks, LttvTraceHook, hn++));
if(ret) hn--;
+ ret = lttv_trace_find_hook(ts->parent.t,
+ LTT_FACILITY_LIST, LTT_EVENT_LIST_INTERRUPT,
+ LTT_FIELD_ACTION, LTT_FIELD_NUM, 0,
+ enum_interrupt, NULL, &g_array_index(hooks, LttvTraceHook, hn++));
+ if(ret) hn--;
+
ret = lttv_trace_find_hook(ts->parent.t,
LTT_FACILITY_BLOCK, LTT_EVENT_REQUEST_ISSUE,
LTT_FIELD_MAJOR, LTT_FIELD_MINOR, LTT_FIELD_OPERATION,
LTT_EVENT_THREAD_BRAND = g_quark_from_string("thread_brand");
LTT_EVENT_REQUEST_ISSUE = g_quark_from_string("_blk_request_issue");
LTT_EVENT_REQUEST_COMPLETE = g_quark_from_string("_blk_request_complete");
+ LTT_EVENT_LIST_INTERRUPT = g_quark_from_string("interrupt");;
LTT_FIELD_SYSCALL_ID = g_quark_from_string("syscall_id");
LTT_FIELD_MAJOR = g_quark_from_string("major");
LTT_FIELD_MINOR = g_quark_from_string("minor");
LTT_FIELD_OPERATION = g_quark_from_string("direction");
+ LTT_FIELD_ACTION = g_quark_from_string("action");
+ LTT_FIELD_NUM = g_quark_from_string("num");
LTTV_CPU_UNKNOWN = g_quark_from_string("unknown");
LTTV_CPU_IDLE = g_quark_from_string("idle");