AC_PREREQ(2.57)
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
#AC_WITH_LTDL # not needed ?
-AM_INIT_AUTOMAKE(lttv,0.11.6-13112008)
+AM_INIT_AUTOMAKE(lttv,0.12.0-13122008)
AM_CONFIG_HEADER(config.h)
AM_PROG_LIBTOOL
required in order to compile LinuxTraceToolkit]))
-# pthread for lttd
-#AC_CHECK_LIB(pthread, pthread_join,[THREAD_LIBS="-lpthread"], AC_MSG_ERROR([LinuxThreads is required in order to compile lttd]))
+# pthread for gdb with dlopen().
+AC_CHECK_LIB(pthread, pthread_join,[THREAD_LIBS="-lpthread"], AC_MSG_ERROR([LinuxThreads is required in order to make sure gdb works fine with lttv-gui]))
# Checks for header files.
AC_HEADER_STDC
AM_CFLAGS = $(GLIB_CFLAGS)
LIBS += $(GLIB_LIBS)
+LIBS += $(THREAD_LIBS)
lib_LTLIBRARIES = liblttvtraceread.la
liblttvtraceread_la_SOURCES = tracefile.c marker.c event.c
/*****************************************************************************
* The string obtained is only valid until the next read from
- * the same tracefile.
+ * the same tracefile. We reference directly the buffers.
****************************************************************************/
-char *ltt_event_get_string(LttEvent *e, struct marker_field *f)
+gchar *ltt_event_get_string(LttEvent *e, struct marker_field *f)
{
g_assert(f->type == LTT_TYPE_STRING);
- return (gchar*)g_strdup((gchar*)(e->data + f->offset));
+ //caused memory leaks
+ //return (gchar*)g_strdup((gchar*)(e->data + f->offset));
+ return (gchar*)(e->data + f->offset);
}
return event->event_id;
}
-static inline LttTime ltt_event_time(struct LttEvent *event)
+static inline LttTime ltt_event_time(const struct LttEvent *event)
{
return event->event_time;
}
typedef guint64 uint64_t;
/* Subbuffer header */
-struct ltt_subbuffer_header_2_2 {
+struct ltt_subbuffer_header_2_3 {
uint64_t cycle_count_begin; /* Cycle count at subbuffer start */
uint64_t cycle_count_end; /* Cycle count at subbuffer end */
uint32_t magic_number; /*
char header_end[0]; /* End of header */
};
-typedef struct ltt_subbuffer_header_2_2 ltt_subbuffer_header_t;
+typedef struct ltt_subbuffer_header_2_3 ltt_subbuffer_header_t;
/*
* Return header size without padding after the structure. Don't use packed
guint pgid; //Usertrace pgid, else 0
guint64 creation; //Usertrace creation, else 0
LttTrace * trace; //trace containing the tracefile
+ struct marker_data *mdata; // marker id/name/fields mapping
int fd; //file descriptor
off_t file_size; //file size
//unsigned block_size; //block_size
contained information (byte offsets) may vary with the architecture
associated to the trace. */
-#define PREALLOC_EVENTS 512
+#define PREALLOC_EVENTS 28
typedef struct LttTrace LttTrace;
return 0;
}
-int marker_format_event(LttTrace *trace, GQuark name, const char *format)
+int marker_format_event(LttTrace *trace, GQuark channel, GQuark name,
+ const char *format)
{
struct marker_info *info;
+ struct marker_data *mdata;
char *fquery;
char *fcopy;
-
- fquery = marker_get_format_from_name(trace, name);
+ GArray *group;
+
+ group = g_datalist_id_get_data(&trace->tracefiles, channel);
+ g_assert(group->len > 0);
+ mdata = g_array_index (group, LttTracefile, 0).mdata;
+
+ fquery = marker_get_format_from_name(mdata, name);
if (fquery) {
if (strcmp(fquery, format) != 0)
- g_error("Marker format mismatch \"%s\" vs \"%s\" for marker %s. "
- "Kernel issue.", fquery, format, g_quark_to_string(name));
+ g_error("Marker format mismatch \"%s\" vs \"%s\" for marker %s.%s. "
+ "Kernel issue.", fquery, format,
+ g_quark_to_string(channel), g_quark_to_string(name));
else
return 0; /* Already exists. Nothing to do. */
}
fcopy = g_new(char, strlen(format)+1);
strcpy(fcopy, format);
- g_hash_table_insert(trace->markers_format_hash, (gpointer)(gulong)name,
+ g_hash_table_insert(mdata->markers_format_hash, (gpointer)(gulong)name,
(gpointer)fcopy);
- info = marker_get_info_from_name(trace, name);
+ info = marker_get_info_from_name(mdata, name);
for (; info != NULL; info = info->next) {
info->format = fcopy;
if (marker_parse_format(format, info))
- g_error("Error parsing marker format \"%s\" for marker \"%s\"", format,
- g_quark_to_string(name));
+ g_error("Error parsing marker format \"%s\" for marker \"%.s.%s\"",
+ format, g_quark_to_string(channel), g_quark_to_string(name));
}
return 0;
}
-int marker_id_event(LttTrace *trace, GQuark name, guint16 id,
+int marker_id_event(LttTrace *trace, GQuark channel, GQuark name, guint16 id,
uint8_t int_size, uint8_t long_size, uint8_t pointer_size,
uint8_t size_t_size, uint8_t alignment)
{
+ struct marker_data *mdata;
struct marker_info *info, *head;
int found = 0;
+ GArray *group;
+
+ g_debug("Add channel %s event %s %hu\n", g_quark_to_string(channel),
+ g_quark_to_string(name), id);
+
+ group = g_datalist_id_get_data(&trace->tracefiles, channel);
+ g_assert(group->len > 0);
+ mdata = g_array_index (group, LttTracefile, 0).mdata;
- if (trace->markers->len <= id)
- trace->markers = g_array_set_size(trace->markers,
- max(trace->markers->len * 2, id + 1));
- info = &g_array_index(trace->markers, struct marker_info, id);
+ if (mdata->markers->len <= id)
+ mdata->markers = g_array_set_size(mdata->markers,
+ max(mdata->markers->len * 2, id + 1));
+ info = &g_array_index(mdata->markers, struct marker_info, id);
info->name = name;
info->int_size = int_size;
info->long_size = long_size;
info->alignment = alignment;
info->fields = NULL;
info->next = NULL;
- info->format = marker_get_format_from_name(trace, name);
+ info->format = marker_get_format_from_name(mdata, name);
info->largest_align = 1;
if (info->format && marker_parse_format(info->format, info))
- g_error("Error parsing marker format \"%s\" for marker \"%s\"",
- info->format, g_quark_to_string(name));
- head = marker_get_info_from_name(trace, name);
+ g_error("Error parsing marker format \"%s\" for marker \"%s.%s\"",
+ info->format, g_quark_to_string(channel), g_quark_to_string(name));
+ head = marker_get_info_from_name(mdata, name);
if (!head)
- g_hash_table_insert(trace->markers_hash, (gpointer)(gulong)name,
+ g_hash_table_insert(mdata->markers_hash, (gpointer)(gulong)name,
(gpointer)(gulong)id);
else {
struct marker_info *iter;
if (iter->name == name)
found = 1;
if (!found) {
- g_hash_table_replace(trace->markers_hash, (gpointer)(gulong)name,
+ g_hash_table_replace(mdata->markers_hash, (gpointer)(gulong)name,
(gpointer)(gulong)id);
info->next = head;
}
return 0;
}
-int allocate_marker_data(LttTrace *trace)
+struct marker_data *allocate_marker_data(void)
{
+ struct marker_data *data;
+
+ data = g_new(struct marker_data, 1);
/* Init array to 0 */
- trace->markers = g_array_sized_new(FALSE, TRUE,
+ data->markers = g_array_sized_new(FALSE, TRUE,
sizeof(struct marker_info), DEFAULT_MARKERS_NUM);
- if (!trace->markers)
- return -ENOMEM;
- trace->markers_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
- if (!trace->markers_hash)
- return -ENOMEM;
- trace->markers_format_hash = g_hash_table_new_full(g_direct_hash,
+ if (!data->markers)
+ goto free_data;
+ data->markers_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
+ if (!data->markers_hash)
+ goto free_markers;
+ data->markers_format_hash = g_hash_table_new_full(g_direct_hash,
g_direct_equal, NULL, g_free);
- if (!trace->markers_hash)
- return -ENOMEM;
- return 0;
+ if (!data->markers_format_hash)
+ goto free_markers_hash;
+ return data;
+
+ /* error handling */
+free_markers_hash:
+ g_hash_table_destroy(data->markers_hash);
+free_markers:
+ g_array_free(data->markers, TRUE);
+free_data:
+ g_free(data);
+ return NULL;
}
-void destroy_marker_data(LttTrace *trace)
+void destroy_marker_data(struct marker_data *data)
{
unsigned int i, j;
struct marker_info *info;
struct marker_field *field;
- for (i=0; i<trace->markers->len; i++) {
- info = &g_array_index(trace->markers, struct marker_info, i);
+ for (i=0; i<data->markers->len; i++) {
+ info = &g_array_index(data->markers, struct marker_info, i);
if (info->fields) {
for (j = 0; j < info->fields->len; j++) {
field = &g_array_index(info->fields, struct marker_field, j);
g_array_free(info->fields, TRUE);
}
}
- g_array_free(trace->markers, TRUE);
- g_hash_table_destroy(trace->markers_hash);
- g_hash_table_destroy(trace->markers_format_hash);
+ g_hash_table_destroy(data->markers_format_hash);
+ g_hash_table_destroy(data->markers_hash);
+ g_array_free(data->markers, TRUE);
+ g_free(data);
}
struct marker_info *next; /* Linked list of markers with the same name */
};
+struct marker_data {
+ GArray *markers; //indexed by marker id
+ GHashTable *markers_hash; //indexed by name hash
+ GHashTable *markers_format_hash; //indexed by name hash
+};
+
enum marker_id {
MARKER_ID_SET_MARKER_ID = 0, /* Static IDs available (range 0-7) */
MARKER_ID_SET_MARKER_FORMAT,
MARKER_ID_DYNAMIC, /* Dynamic IDs (range: 8-65535) */
};
-static inline guint16 marker_get_id_from_info(LttTrace *trace,
+static inline guint16 marker_get_id_from_info(struct marker_data *data,
struct marker_info *info)
{
- return ((unsigned long)info - (unsigned long)trace->markers->data)
+ return ((unsigned long)info - (unsigned long)data->markers->data)
/ sizeof(struct marker_info);
}
-static inline struct marker_info *marker_get_info_from_id(LttTrace *trace,
- guint16 id)
+static inline struct marker_info *marker_get_info_from_id(
+ struct marker_data *data, guint16 id)
{
- if (unlikely(trace->markers->len <= id))
+ if (unlikely(data->markers->len <= id))
return NULL;
- return &g_array_index(trace->markers, struct marker_info, id);
+ return &g_array_index(data->markers, struct marker_info, id);
}
/*
* Returns the head of the marker info list for that name.
*/
-static inline struct marker_info *marker_get_info_from_name(LttTrace *trace,
- GQuark name)
+static inline struct marker_info *marker_get_info_from_name(
+ struct marker_data *data, GQuark name)
{
gpointer orig_key, value;
int res;
- res = g_hash_table_lookup_extended(trace->markers_hash,
+ res = g_hash_table_lookup_extended(data->markers_hash,
(gconstpointer)(gulong)name, &orig_key, &value);
if (!res)
return NULL;
- return marker_get_info_from_id(trace, (guint16)(gulong)value);
+ return marker_get_info_from_id(data, (guint16)(gulong)value);
}
-static inline char *marker_get_format_from_name(LttTrace *trace,
+static inline char *marker_get_format_from_name(struct marker_data *data,
GQuark name)
{
gpointer orig_key, value;
int res;
- res = g_hash_table_lookup_extended(trace->markers_format_hash,
+ res = g_hash_table_lookup_extended(data->markers_format_hash,
(gconstpointer)(gulong)name, &orig_key, &value);
if (!res)
return NULL;
field != marker_get_field(info, marker_get_num_fields(info)); \
field++)
-int marker_format_event(LttTrace *trace, GQuark name, const char *format);
-int marker_id_event(LttTrace *trace, GQuark name, guint16 id,
+int marker_format_event(LttTrace *trace, GQuark channel, GQuark name,
+ const char *format);
+int marker_id_event(LttTrace *trace, GQuark channel, GQuark name, guint16 id,
uint8_t int_size, uint8_t long_size, uint8_t pointer_size,
uint8_t size_t_size, uint8_t alignment);
-int allocate_marker_data(LttTrace *trace);
-void destroy_marker_data(LttTrace *trace);
+struct marker_data *allocate_marker_data(void);
+void destroy_marker_data(struct marker_data *data);
#endif //_LTT_MARKERS_H
LttTime start_time_from_tsc;
GData *tracefiles; //tracefiles groups
- /* Support for markers */
- GArray *markers; //indexed by marker ID
- GHashTable *markers_hash; //indexed by name hash
- GHashTable *markers_format_hash; //indexed by name hash
};
static inline guint ltt_trace_get_num_cpu(LttTrace *t)
break;
case 2:
switch(header->minor_version) {
- case 2:
+ case 3:
{
- struct ltt_subbuffer_header_2_2 *vheader = header;
+ struct ltt_subbuffer_header_2_3 *vheader = header;
tf->buffer_header_size = ltt_subbuffer_header_size();
tf->tscbits = 27;
tf->eventbits = 5;
/* Search for something like : .*_.*
*
* The left side is the name, the right side is the number.
+ * Exclude leading /.
*/
static int get_tracefile_name_number(gchar *raw_name,
gchar *endptr;
gchar *tmpptr;
+ /* skip leading / */
+ for(i = 0; i < raw_name_len-1;i++) {
+ if(raw_name[i] != '/')
+ break;
+ }
+ raw_name = &raw_name[i];
+ raw_name_len = strlen(raw_name);
+
for(i=raw_name_len-1;i>=0;i--) {
if(raw_name[i] == '_') break;
}
int i;
LttTracefile *tf;
+ if (group->len > 0)
+ destroy_marker_data(g_array_index (group, LttTracefile, 0).mdata);
for(i=0; i<group->len; i++) {
tf = &g_array_index (group, LttTracefile, i);
if(tf->cpu_online)
DIR *dir = opendir(root_path);
struct dirent *entry;
struct stat stat_buf;
- int ret;
+ int ret, i;
+ struct marker_data *mdata;
gchar path[PATH_MAX];
int path_len;
g_debug("Tracefile name is %s and number is %u",
g_quark_to_string(name), num);
-
+
+ mdata = NULL;
tmp_tf.cpu_online = 1;
tmp_tf.cpu_num = num;
tmp_tf.name = name;
group = g_array_sized_new (FALSE, TRUE, sizeof(LttTracefile), 10);
g_datalist_id_set_data_full(&trace->tracefiles, name,
group, ltt_tracefile_group_destroy);
+ mdata = allocate_marker_data();
+ if (!mdata)
+ g_error("Error in allocating marker data");
}
/* Add the per cpu tracefile to the named group */
unsigned int old_len = group->len;
if(num+1 > old_len)
group = g_array_set_size(group, num+1);
+
+ g_assert(group->len > 0);
+ if (!mdata)
+ mdata = g_array_index (group, LttTracefile, 0).mdata;
+
g_array_index (group, LttTracefile, num) = tmp_tf;
g_array_index (group, LttTracefile, num).event.tracefile =
&g_array_index (group, LttTracefile, num);
+ for (i = 0; i < group->len; i++)
+ g_array_index (group, LttTracefile, i).mdata = mdata;
}
}
goto event_id_error;
} else {
char *pos;
- const char *marker_name, *format;
+ const char *channel_name, *marker_name, *format;
uint16_t id;
guint8 int_size, long_size, pointer_size, size_t_size, alignment;
switch((enum marker_id)tf->event.event_id) {
case MARKER_ID_SET_MARKER_ID:
- marker_name = pos = tf->event.data;
- g_debug("Doing MARKER_ID_SET_MARKER_ID of marker %s", marker_name);
+ channel_name = pos = tf->event.data;
+ pos += strlen(channel_name) + 1;
+ marker_name = pos;
+ g_debug("Doing MARKER_ID_SET_MARKER_ID of marker %s.%s",
+ channel_name, marker_name);
pos += strlen(marker_name) + 1;
pos += ltt_align((size_t)pos, sizeof(guint16), tf->alignment);
id = ltt_get_uint16(LTT_GET_BO(tf), pos);
- g_debug("In MARKER_ID_SET_MARKER_ID of marker %s id %hu",
- marker_name, id);
+ g_debug("In MARKER_ID_SET_MARKER_ID of marker %s.%s id %hu",
+ channel_name, marker_name, id);
pos += sizeof(guint16);
int_size = *(guint8*)pos;
pos += sizeof(guint8);
pos += sizeof(guint8);
alignment = *(guint8*)pos;
pos += sizeof(guint8);
- marker_id_event(tf->trace, g_quark_from_string(marker_name),
+ marker_id_event(tf->trace,
+ g_quark_from_string(channel_name),
+ g_quark_from_string(marker_name),
id, int_size, long_size,
pointer_size, size_t_size, alignment);
break;
case MARKER_ID_SET_MARKER_FORMAT:
- marker_name = pos = tf->event.data;
- g_debug("Doing MARKER_ID_SET_MARKER_FORMAT of marker %s",
- marker_name);
+ channel_name = pos = tf->event.data;
+ pos += strlen(channel_name) + 1;
+ marker_name = pos;
+ g_debug("Doing MARKER_ID_SET_MARKER_FORMAT of marker %s.%s",
+ channel_name, marker_name);
pos += strlen(marker_name) + 1;
format = pos;
pos += strlen(format) + 1;
- marker_format_event(tf->trace, g_quark_from_string(marker_name),
+ marker_format_event(tf->trace,
+ g_quark_from_string(channel_name),
+ g_quark_from_string(marker_name),
format);
/* get information from dictionary TODO */
break;
ltt_subbuffer_header_t *header;
DIR *dir;
struct dirent *entry;
- guint control_found = 0;
struct stat stat_buf;
gchar path[PATH_MAX];
perror(path);
continue;
}
- if(S_ISDIR(stat_buf.st_mode)) {
- if(strcmp(entry->d_name, "control") == 0) {
- control_found = 1;
- }
- }
}
closedir(dir);
- if(!control_found) goto find_error;
-
/* Open all the tracefiles */
if(open_tracefiles(t, abs_path, "")) {
g_warning("Error opening tracefile %s", abs_path);
goto find_error;
}
- /* Parse each trace control/metadata_N files : get runtime fac. info */
+ /* Parse each trace metadata_N files : get runtime fac. info */
group = g_datalist_id_get_data(&t->tracefiles, LTT_TRACEFILE_NAME_METADATA);
if(group == NULL) {
g_error("Trace %s has no metadata tracefile", abs_path);
g_assert(0);
- goto metadata_error;
+ goto find_error;
}
/*
- * Get the trace information for the control/metadata_0 tracefile.
+ * Get the trace information for the metadata_0 tracefile.
* Getting a correct trace start_time and start_tsc is insured by the fact
* that no subbuffers are supposed to be lost in the metadata channel.
* Therefore, the first subbuffer contains the start_tsc timestamp in its
t->num_cpu = group->len;
- ret = allocate_marker_data(t);
- if (ret)
- g_error("Error in allocating marker data");
+ //ret = allocate_marker_data(t);
+ //if (ret)
+ // g_error("Error in allocating marker data");
for(i=0; i<group->len; i++) {
tf = &g_array_index (group, LttTracefile, i);
if (tf->cpu_online)
if(ltt_process_metadata_tracefile(tf))
- goto metadata_error;
+ goto find_error;
+ // goto metadata_error;
}
return t;
/* Error handling */
-metadata_error:
- destroy_marker_data(t);
+//metadata_error:
+// destroy_marker_data(t);
find_error:
g_datalist_clear(&t->tracefiles);
open_error:
off_t size = 0;
char *tscdata;
struct marker_info *info;
-
- switch((enum marker_id)tf->event.event_id) {
- case MARKER_ID_SET_MARKER_ID:
- size = strlen((char*)tf->event.data) + 1;
- g_debug("marker %s id set", (char*)tf->event.data);
- size += ltt_align(size, sizeof(guint16), tf->alignment);
- size += sizeof(guint16);
- size += sizeof(guint8);
- size += sizeof(guint8);
- size += sizeof(guint8);
- size += sizeof(guint8);
- size += sizeof(guint8);
- break;
- case MARKER_ID_SET_MARKER_FORMAT:
- g_debug("marker %s format set", (char*)tf->event.data);
- size = strlen((char*)tf->event.data) + 1;
- size += strlen((char*)tf->event.data + size) + 1;
- break;
+
+ if (tf->name == LTT_TRACEFILE_NAME_METADATA) {
+ switch((enum marker_id)tf->event.event_id) {
+ case MARKER_ID_SET_MARKER_ID:
+ size = strlen((char*)tf->event.data) + 1;
+ g_debug("marker %s id set", (char*)tf->event.data + size);
+ size += strlen((char*)tf->event.data + size) + 1;
+ size += ltt_align(size, sizeof(guint16), tf->alignment);
+ size += sizeof(guint16);
+ size += sizeof(guint8);
+ size += sizeof(guint8);
+ size += sizeof(guint8);
+ size += sizeof(guint8);
+ size += sizeof(guint8);
+ break;
+ case MARKER_ID_SET_MARKER_FORMAT:
+ size = strlen((char*)tf->event.data) + 1;
+ g_debug("marker %s format set", (char*)tf->event.data);
+ size += strlen((char*)tf->event.data + size) + 1;
+ size += strlen((char*)tf->event.data + size) + 1;
+ break;
+ }
}
- info = marker_get_info_from_id(tf->trace, tf->event.event_id);
+ info = marker_get_info_from_id(tf->mdata, tf->event.event_id);
if (tf->event.event_id >= MARKER_CORE_IDS)
g_assert(info != NULL);
if (info->size != -1)
size = info->size;
else
- size = marker_update_fields_offsets(marker_get_info_from_id(tf->trace,
+ size = marker_update_fields_offsets(marker_get_info_from_id(tf->mdata,
tf->event.event_id), tf->event.data);
}
if (a_event_debug)
print_debug_event_data(&tf->event);
- /* Having a marker load or marker format event out of the metadata
- * tracefiles is a serious bug. */
- switch((enum marker_id)tf->event.event_id) {
- case MARKER_ID_SET_MARKER_ID:
- case MARKER_ID_SET_MARKER_FORMAT:
- if (tf->name != g_quark_from_string("/control/metadata"))
- g_error("Trace inconsistency : metadata event found in data "
- "tracefile %s", g_quark_to_string(tf->long_name));
- }
-
if (tf->event.data_size != tf->event.event_size) {
- struct marker_info *info = marker_get_info_from_id(tf->trace,
+ struct marker_info *info = marker_get_info_from_id(tf->mdata,
tf->event.event_id);
+ if (!info)
+ g_error("Undescribed event %hhu in channel %s", tf->event.event_id,
+ g_quark_to_string(tf->name));
g_error("Kernel/LTTV event size differs for event %s: kernel %u, LTTV %u",
g_quark_to_string(info->name),
tf->event.event_size, tf->event.data_size);
static __attribute__((constructor)) void init(void)
{
- LTT_TRACEFILE_NAME_METADATA = g_quark_from_string("/control/metadata");
+ LTT_TRACEFILE_NAME_METADATA = g_quark_from_string("metadata");
}
AM_CFLAGS = $(GLIB_CFLAGS)
+LIBS += $(THREAD_LIBS)
LIBS += $(POPT_LIBS) $(GLIB_LIBS) -lgobject-2.0 -L${top_builddir}/ltt\
-llttvtraceread
ltt_event_position(e, a_event_position);
ltt_event_position_get(a_event_position, &tf, &nb_block, &offset, &tsc);
fprintf(stderr,"Event %s %lu.%09lu [%u 0x%x tsc %llu]\n",
- g_quark_to_string(marker_get_info_from_id(ltt_tracefile_get_trace(tf),
+ g_quark_to_string(marker_get_info_from_id(tf->mdata,
ltt_event_id(e))->name),
tfs->parent.timestamp.tv_sec, tfs->parent.timestamp.tv_nsec,
nb_block, offset, tsc);
FILE *fp;
- LttTrace *trace = ((LttvTracefileContext *)tfs)->t_context->t;
-
if(ts->nb_event == 0 &&
- marker_get_info_from_id(trace, e->event_id)->name
+ marker_get_info_from_id(tfs->parent.tf->mdata, e->event_id)->name
== QUARK_BLOCK_START) {
if(a_save_sample != NULL) {
filename = g_string_new("");
do {
LttTracefile *tf_pos;
//event_type = ltt_event_eventtype(event);
- minfo = marker_get_info_from_id(ltt_tracefile_get_trace(tracefile),
+ minfo = marker_get_info_from_id(tracefile->mdata,
ltt_event_id(event));
time = ltt_event_time(event);
ltt_event_position(event, a_event_position);
if(event == NULL) return TRUE;
else {
struct marker_info *info;
- info = marker_get_info_from_id((LttTrace *)trace, event->event_id);
+ LttTracefile *tf = context->tf;
+ info = marker_get_info_from_id(tf->mdata, event->event_id);
g_assert(info != NULL);
GQuark quark = info->name;
return se->op((gpointer)&quark,v);
{
LttvHooksById *h = g_new(LttvHooksById, 1);
h->index = g_ptr_array_sized_new(PREALLOC_EVENTS);
- h->array = g_array_sized_new(FALSE, FALSE, sizeof(guint), 50);
+ h->array = g_array_sized_new(FALSE, FALSE, sizeof(guint), PREALLOC_EVENTS);
return h;
}
}
}
+void lttv_hooks_by_id_copy(LttvHooksById *dest, LttvHooksById *src)
+{
+ guint i;
+
+ for(i = 0 ; i < src->array->len ; i++) {
+ guint index = g_array_index(src->array, guint, i);
+ LttvHooks *srch = lttv_hooks_by_id_find(src, index);
+ LttvHooks *desth = lttv_hooks_by_id_find(dest, index);
+ lttv_hooks_add_list(desth, srch);
+ }
+}
+
+LttvHooksByIdChannelArray *lttv_hooks_by_id_channel_new(void)
+{
+ LttvHooksByIdChannelArray *h = g_new(LttvHooksByIdChannelArray, 1);
+
+ h->array = g_array_new(FALSE, FALSE, sizeof(LttvHooksByIdChannel));
+ return h;
+}
+
+void lttv_hooks_by_id_channel_destroy(LttvHooksByIdChannelArray *h)
+{
+ LttvHooksByIdChannel *hid;
+ int i;
+
+ for (i = 0; i < h->array->len; i++) {
+ hid = &g_array_index(h->array, LttvHooksByIdChannel, i);
+ lttv_hooks_by_id_destroy(hid->hooks_by_id);
+ }
+ g_array_free(h->array, TRUE);
+ g_free(h);
+}
+
+static LttvHooksByIdChannel *lttv_hooks_by_id_channel_find_channel(
+ LttvHooksByIdChannelArray *h,
+ GQuark channel)
+{
+ LttvHooksByIdChannel *hid;
+ int i, found = 0;
+
+ for (i = 0; i < h->array->len; i++) {
+ hid = &g_array_index(h->array, LttvHooksByIdChannel, i);
+ if (hid->channel == channel)
+ found = 1;
+ break;
+ }
+ if (!found) {
+ g_array_set_size(h->array, h->array->len + 1);
+ hid = &g_array_index(h->array, LttvHooksByIdChannel, h->array->len - 1);
+ hid->channel = channel;
+ hid->hooks_by_id = lttv_hooks_by_id_new();
+ }
+ return hid;
+}
+
+/* get, or create if not found */
+LttvHooks *lttv_hooks_by_id_channel_find(LttvHooksByIdChannelArray *h,
+ GQuark channel, guint16 id)
+{
+ LttvHooksByIdChannel *hid;
+ hid = lttv_hooks_by_id_channel_find_channel(h, channel);
+ return lttv_hooks_by_id_find(hid->hooks_by_id, id);
+}
/* Create and destroy a hooks by id list */
-LttvHooksById *lttv_hooks_by_id_new();
+LttvHooksById *lttv_hooks_by_id_new(void);
void lttv_hooks_by_id_destroy(LttvHooksById *h);
return ret;
}
-
/* Remove the list of hooks associated with an id */
void lttv_hooks_by_id_remove(LttvHooksById *h, unsigned id);
+void lttv_hooks_by_id_copy(LttvHooksById *dest, LttvHooksById *src);
+
+/*
+ * Hooks per channel per id. Useful for GUI to save/restore hooks
+ * on a per trace basis (rather than per tracefile).
+ */
+
+/* Internal structure, contained in by the LttvHooksByIdChannelArray */
+typedef struct _LttvHooksByIdChannel {
+ LttvHooksById *hooks_by_id;
+ GQuark channel;
+} LttvHooksByIdChannel;
+
+typedef struct _LttvHooksByIdChannelArray {
+ GArray *array; /* Array of LttvHooksByIdChannel */
+} LttvHooksByIdChannelArray;
+
+LttvHooksByIdChannelArray *lttv_hooks_by_id_channel_new(void);
+
+void lttv_hooks_by_id_channel_destroy(LttvHooksByIdChannelArray *h);
+
+LttvHooks *lttv_hooks_by_id_channel_find(LttvHooksByIdChannelArray *h,
+ GQuark channel, guint16 id);
+
#endif // HOOK_H
static inline void print_enum_events(LttEvent *e, struct marker_field *f,
guint64 value, GString *s, LttvTracefileState *tfs)
{
- LttTrace *trace = ltt_tracefile_get_trace(e->tracefile);
- struct marker_info *info = marker_get_info_from_id(trace, e->event_id);
+ struct marker_info *info = marker_get_info_from_id(tfs->parent.tf->mdata,
+ e->event_id);
LttvTraceState *ts = (LttvTraceState*)(tfs->parent.t_context);
//TODO optimize with old quarks.
guint cpu = tfs->cpu;
LttvTraceState *ts = (LttvTraceState*)tfs->parent.t_context;
LttvProcessState *process = ts->running_process[cpu];
- LttTrace *trace = ts->parent.t;
s = g_string_set_size(s,0);
- info = marker_get_info_from_id(trace, e->event_id);
+ info = marker_get_info_from_id(tfs->parent.tf->mdata, e->event_id);
if(mandatory_fields) {
time = ltt_event_time(e);
#define PREALLOCATED_EXECUTION_STACK 10
-/* Facilities Quarks */
+/* Channel Quarks */
GQuark
- LTT_FACILITY_KERNEL,
- LTT_FACILITY_LIST,
- LTT_FACILITY_FS,
- LTT_FACILITY_USER_GENERIC,
- LTT_FACILITY_BLOCK,
- LTT_FACILITY_STATEDUMP;
+ LTT_CHANNEL_FD_STATE,
+ LTT_CHANNEL_GLOBAL_STATE,
+ LTT_CHANNEL_IRQ_STATE,
+ LTT_CHANNEL_MODULE_STATE,
+ LTT_CHANNEL_NETIF_STATE,
+ LTT_CHANNEL_SOFTIRQ_STATE,
+ LTT_CHANNEL_SWAP_STATE,
+ LTT_CHANNEL_SYSCALL_STATE,
+ LTT_CHANNEL_TASK_STATE,
+ LTT_CHANNEL_VM_STATE,
+ LTT_CHANNEL_FS,
+ LTT_CHANNEL_KERNEL,
+ LTT_CHANNEL_MM,
+ LTT_CHANNEL_USERSPACE,
+ LTT_CHANNEL_BLOCK;
/* Events Quarks */
hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 1);
if(!lttv_trace_find_hook(tcs->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SYSCALL_ENTRY,
FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
NULL, NULL, &hooks)) {
lttv_trace_hook_remove_all(&hooks);
if(!lttv_trace_find_hook(tcs->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_TRAP_ENTRY,
FIELD_ARRAY(LTT_FIELD_TRAP_ID),
NULL, NULL, &hooks)) {
lttv_trace_hook_remove_all(&hooks);
if(!lttv_trace_find_hook(tcs->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_IRQ_ID),
NULL, NULL, &hooks)) {
//hn = 0;
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SYSCALL_ENTRY,
FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
syscall_entry, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SYSCALL_EXIT,
NULL,
syscall_exit, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_TRAP_ENTRY,
FIELD_ARRAY(LTT_FIELD_TRAP_ID),
trap_entry, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_TRAP_EXIT,
NULL,
trap_exit, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_IRQ_ID),
irq_entry, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_EXIT,
NULL,
irq_exit, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_RAISE,
FIELD_ARRAY(LTT_FIELD_SOFT_IRQ_ID),
soft_irq_raise, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_SOFT_IRQ_ID),
soft_irq_entry, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_EXIT,
NULL,
soft_irq_exit, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SCHED_SCHEDULE,
FIELD_ARRAY(LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID,
LTT_FIELD_PREV_STATE),
schedchange, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_PROCESS_FORK,
FIELD_ARRAY(LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID,
LTT_FIELD_CHILD_TGID),
process_fork, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_KTHREAD_CREATE,
FIELD_ARRAY(LTT_FIELD_PID),
process_kernel_thread, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_PROCESS_EXIT,
FIELD_ARRAY(LTT_FIELD_PID),
process_exit, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_PROCESS_FREE,
FIELD_ARRAY(LTT_FIELD_PID),
process_free, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_FS,
+ LTT_CHANNEL_FS,
LTT_EVENT_EXEC,
FIELD_ARRAY(LTT_FIELD_FILENAME),
process_exec, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_USER_GENERIC,
+ LTT_CHANNEL_USERSPACE,
LTT_EVENT_THREAD_BRAND,
FIELD_ARRAY(LTT_FIELD_NAME),
thread_brand, NULL, &hooks);
/* statedump-related hooks */
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_LIST,
+ LTT_CHANNEL_TASK_STATE,
LTT_EVENT_PROCESS_STATE,
FIELD_ARRAY(LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME,
LTT_FIELD_TYPE, LTT_FIELD_MODE, LTT_FIELD_SUBMODE,
enum_process_state, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_LIST,
+ LTT_CHANNEL_GLOBAL_STATE,
LTT_EVENT_STATEDUMP_END,
NULL,
statedump_end, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_LIST,
+ LTT_CHANNEL_IRQ_STATE,
LTT_EVENT_LIST_INTERRUPT,
FIELD_ARRAY(LTT_FIELD_ACTION, LTT_FIELD_IRQ_ID),
enum_interrupt, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_BLOCK,
+ LTT_CHANNEL_BLOCK,
LTT_EVENT_REQUEST_ISSUE,
FIELD_ARRAY(LTT_FIELD_MAJOR, LTT_FIELD_MINOR, LTT_FIELD_OPERATION),
bdev_request_issue, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_BLOCK,
+ LTT_CHANNEL_BLOCK,
LTT_EVENT_REQUEST_COMPLETE,
FIELD_ARRAY(LTT_FIELD_MAJOR, LTT_FIELD_MINOR, LTT_FIELD_OPERATION),
bdev_request_complete, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_USER_GENERIC,
+ LTT_CHANNEL_USERSPACE,
LTT_EVENT_FUNCTION_ENTRY,
FIELD_ARRAY(LTT_FIELD_THIS_FN, LTT_FIELD_CALL_SITE),
function_entry, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_USER_GENERIC,
+ LTT_CHANNEL_USERSPACE,
LTT_EVENT_FUNCTION_EXIT,
FIELD_ARRAY(LTT_FIELD_THIS_FN, LTT_FIELD_CALL_SITE),
function_exit, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_STATEDUMP,
+ LTT_CHANNEL_SYSCALL_STATE,
LTT_EVENT_SYS_CALL_TABLE,
FIELD_ARRAY(LTT_FIELD_ID, LTT_FIELD_ADDRESS, LTT_FIELD_SYMBOL),
dump_syscall, NULL, &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_STATEDUMP,
+ LTT_CHANNEL_SOFTIRQ_STATE,
LTT_EVENT_SOFTIRQ_VEC,
FIELD_ARRAY(LTT_FIELD_ID, LTT_FIELD_ADDRESS, LTT_FIELD_SYMBOL),
dump_softirq, NULL, &hooks);
for(k = 0 ; k < hooks->len ; k++) {
th = &g_array_index(hooks, LttvTraceHook, k);
- lttv_hooks_add(
- lttv_hooks_by_id_find(tfs->parent.event_by_id, th->id),
- th->h,
- th,
- LTTV_PRIO_STATE);
+ if (th->mdata == tfs->parent.tf->mdata)
+ lttv_hooks_add(
+ lttv_hooks_by_id_find(tfs->parent.event_by_id, th->id),
+ th->h,
+ th,
+ LTTV_PRIO_STATE);
}
}
lttv_attribute_find(ts->parent.a, LTTV_STATE_HOOKS, LTTV_POINTER, &val);
for(k = 0 ; k < hooks->len ; k++) {
th = &g_array_index(hooks, LttvTraceHook, k);
+ if (th->mdata == tfs->parent.tf->mdata)
lttv_hooks_remove_data(
lttv_hooks_by_id_find(tfs->parent.event_by_id, th->id),
th->h,
LTTV_STATE_RESOURCE_TRAPS = g_quark_from_string("trap resource states");
LTTV_STATE_RESOURCE_BLKDEVS = g_quark_from_string("blkdevs resource states");
-
- LTT_FACILITY_KERNEL = g_quark_from_string("kernel");
- LTT_FACILITY_FS = g_quark_from_string("fs");
- LTT_FACILITY_LIST = g_quark_from_string("list");
- LTT_FACILITY_USER_GENERIC = g_quark_from_string("user_generic");
- LTT_FACILITY_BLOCK = g_quark_from_string("block");
- LTT_FACILITY_STATEDUMP = g_quark_from_string("statedump");
-
+ LTT_CHANNEL_FD_STATE = g_quark_from_string("fd_state");
+ LTT_CHANNEL_GLOBAL_STATE = g_quark_from_string("global_state");
+ LTT_CHANNEL_IRQ_STATE = g_quark_from_string("irq_state");
+ LTT_CHANNEL_MODULE_STATE = g_quark_from_string("module_state");
+ LTT_CHANNEL_NETIF_STATE = g_quark_from_string("netif_state");
+ LTT_CHANNEL_SOFTIRQ_STATE = g_quark_from_string("softirq_state");
+ LTT_CHANNEL_SWAP_STATE = g_quark_from_string("swap_state");
+ LTT_CHANNEL_SYSCALL_STATE = g_quark_from_string("syscall_state");
+ LTT_CHANNEL_TASK_STATE = g_quark_from_string("task_state");
+ LTT_CHANNEL_VM_STATE = g_quark_from_string("vm_state");
+ LTT_CHANNEL_FS = g_quark_from_string("fs");
+ LTT_CHANNEL_KERNEL = g_quark_from_string("kernel");
+ LTT_CHANNEL_MM = g_quark_from_string("mm");
+ LTT_CHANNEL_USERSPACE = g_quark_from_string("userspace");
+ LTT_CHANNEL_BLOCK = g_quark_from_string("block");
+
LTT_EVENT_SYSCALL_ENTRY = g_quark_from_string("syscall_entry");
LTT_EVENT_SYSCALL_EXIT = g_quark_from_string("syscall_exit");
LTT_EVENT_TRAP_ENTRY = g_quark_from_string("trap_entry");
#define LTTV_STATE_SAVE_INTERVAL 50000
-/* Facilities Quarks */
+/* Channel Quarks */
extern GQuark
- LTT_FACILITY_KERNEL,
- LTT_FACILITY_FS,
- LTT_FACILITY_LIST,
- LTT_FACILITY_USER_GENERIC,
- LTT_FACILITY_BLOCK,
- LTT_FACILITY_STATEDUMP;
+ LTT_CHANNEL_FD_STATE,
+ LTT_CHANNEL_GLOBAL_STATE,
+ LTT_CHANNEL_IRQ_STATE,
+ LTT_CHANNEL_MODULE_STATE,
+ LTT_CHANNEL_NETIF_STATE,
+ LTT_CHANNEL_SOFTIRQ_STATE,
+ LTT_CHANNEL_SWAP_STATE,
+ LTT_CHANNEL_SYSCALL_STATE,
+ LTT_CHANNEL_TASK_STATE,
+ LTT_CHANNEL_VM_STATE,
+ LTT_CHANNEL_FS,
+ LTT_CHANNEL_KERNEL,
+ LTT_CHANNEL_MM,
+ LTT_CHANNEL_USERSPACE,
+ LTT_CHANNEL_BLOCK;
/* Events Quarks */
LttvAttributeValue v;
- LttTrace *trace = ((LttvTracefileContext *)tfcs)->t_context->t;
-
struct marker_info *info;
/* The current branch corresponds to the tracefile/process/interrupt state.
type occuring in this context. A quark has been pre-allocated for each
event type and is used as name. */
- info = marker_get_info_from_id(trace, e->event_id);
+ info = marker_get_info_from_id(tfcs->parent.parent.tf->mdata, e->event_id);
lttv_attribute_find(tfcs->current_event_types_tree,
info->name, LTTV_UINT, &v);
hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 12);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SYSCALL_ENTRY,
FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
before_syscall_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SYSCALL_EXIT,
NULL,
before_syscall_exit, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_TRAP_ENTRY,
FIELD_ARRAY(LTT_FIELD_TRAP_ID),
before_trap_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_TRAP_EXIT,
NULL,
before_trap_exit, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_IRQ_ID),
before_irq_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_EXIT,
NULL,
before_irq_exit, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_SOFT_IRQ_ID),
before_soft_irq_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_EXIT,
NULL,
before_soft_irq_exit, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SCHED_SCHEDULE,
FIELD_ARRAY(LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE),
before_schedchange, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_USER_GENERIC,
+ LTT_CHANNEL_USERSPACE,
LTT_EVENT_FUNCTION_ENTRY,
FIELD_ARRAY(LTT_FIELD_THIS_FN, LTT_FIELD_CALL_SITE),
before_function_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_USER_GENERIC,
+ LTT_CHANNEL_USERSPACE,
LTT_EVENT_FUNCTION_EXIT,
FIELD_ARRAY(LTT_FIELD_THIS_FN, LTT_FIELD_CALL_SITE),
before_function_exit, NULL,
/* statedump-related hooks */
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_LIST,
+ LTT_CHANNEL_TASK_STATE,
LTT_EVENT_PROCESS_STATE,
FIELD_ARRAY(LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME),
before_enum_process_state, NULL,
hooks = g_array_sized_new(FALSE, FALSE, sizeof(LttvTraceHook), 16);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SYSCALL_ENTRY,
FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
after_syscall_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SYSCALL_EXIT,
NULL,
after_syscall_exit, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_TRAP_ENTRY,
FIELD_ARRAY(LTT_FIELD_TRAP_ID),
after_trap_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_TRAP_EXIT,
NULL,
after_trap_exit, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_IRQ_ID),
after_irq_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_EXIT,
NULL,
after_irq_exit, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_SOFT_IRQ_ID),
after_soft_irq_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_EXIT,
NULL,
after_soft_irq_exit, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SCHED_SCHEDULE,
FIELD_ARRAY(LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE),
after_schedchange, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_PROCESS_FORK,
FIELD_ARRAY(LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID),
process_fork, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_PROCESS_EXIT,
FIELD_ARRAY(LTT_FIELD_PID),
process_exit, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_PROCESS_FREE,
FIELD_ARRAY(LTT_FIELD_PID),
process_free, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_USER_GENERIC,
+ LTT_CHANNEL_USERSPACE,
LTT_EVENT_FUNCTION_ENTRY,
FIELD_ARRAY(LTT_FIELD_THIS_FN, LTT_FIELD_CALL_SITE),
after_function_entry, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_USER_GENERIC,
+ LTT_CHANNEL_USERSPACE,
LTT_EVENT_FUNCTION_EXIT,
FIELD_ARRAY(LTT_FIELD_THIS_FN, LTT_FIELD_CALL_SITE),
after_function_exit, NULL,
/* statedump-related hooks */
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_LIST,
+ LTT_CHANNEL_TASK_STATE,
LTT_EVENT_PROCESS_STATE,
FIELD_ARRAY(LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME),
after_enum_process_state, NULL,
&hooks);
lttv_trace_find_hook(ts->parent.parent.t,
- LTT_FACILITY_LIST,
+ LTT_CHANNEL_GLOBAL_STATE,
LTT_EVENT_STATEDUMP_END,
NULL,
after_statedump_end, NULL,
for(k = 0 ; k < before_hooks->len ; k++) {
th = &g_array_index(before_hooks, LttvTraceHook, k);
- lttv_hooks_add(
- lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, th->id),
- th->h,
- th,
- LTTV_PRIO_STATS_BEFORE_STATE);
+ if (th->mdata == tfs->parent.parent.tf->mdata)
+ lttv_hooks_add(
+ lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, th->id),
+ th->h,
+ th,
+ LTTV_PRIO_STATS_BEFORE_STATE);
}
for(k = 0 ; k < after_hooks->len ; k++) {
th = &g_array_index(after_hooks, LttvTraceHook, k);
- lttv_hooks_add(
- lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, th->id),
- th->h,
- th,
- LTTV_PRIO_STATS_AFTER_STATE);
+ if (th->mdata == tfs->parent.parent.tf->mdata)
+ lttv_hooks_add(
+ lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, th->id),
+ th->h,
+ th,
+ LTTV_PRIO_STATS_AFTER_STATE);
}
}
lttv_attribute_find(self->parent.parent.a, LTTV_STATS_BEFORE_HOOKS,
for(k = 0 ; k < before_hooks->len ; k++) {
th = &g_array_index(before_hooks, LttvTraceHook, k);
- lttv_hooks_remove_data(
- lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, th->id),
- th->h,
- th);
+ if (th->mdata == tfs->parent.parent.tf->mdata)
+ lttv_hooks_remove_data(
+ lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, th->id),
+ th->h,
+ th);
}
for(k = 0 ; k < after_hooks->len ; k++) {
th = &g_array_index(after_hooks, LttvTraceHook, k);
- lttv_hooks_remove_data(
- lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, th->id),
- th->h,
- th);
+ if (th->mdata == tfs->parent.parent.tf->mdata)
+ lttv_hooks_remove_data(
+ lttv_hooks_by_id_find(tfs->parent.parent.event_by_id, th->id),
+ th->h,
+ th);
}
}
#include <lttv/filter.h>
#include <errno.h>
-#define min(a,b) (((a)<(b))?(a):(b))
-
-
gint compare_tracefile(gconstpointer a, gconstpointer b)
{
gint comparison = 0;
LttvHooks *before_trace,
LttvHooks *before_tracefile,
LttvHooks *event,
- LttvHooksById *event_by_id)
+ LttvHooksByIdChannelArray *event_by_id_channel)
{
LttvTraceset *ts = self->ts;
before_trace,
before_tracefile,
event,
- event_by_id);
+ event_by_id_channel);
}
}
LttvHooks *after_trace,
LttvHooks *after_tracefile,
LttvHooks *event,
- LttvHooksById *event_by_id)
+ LttvHooksByIdChannelArray *event_by_id_channel)
{
LttvTraceset *ts = self->ts;
after_trace,
after_tracefile,
event,
- event_by_id);
+ event_by_id_channel);
}
lttv_hooks_call(after_traceset, self);
LttvHooks *before_trace,
LttvHooks *before_tracefile,
LttvHooks *event,
- LttvHooksById *event_by_id)
+ LttvHooksByIdChannelArray *event_by_id_channel)
{
- guint i, nb_tracefile;
-
+ guint i, j, nb_tracefile;
LttvTracefileContext **tfc;
+ LttTracefile *tf;
lttv_hooks_call(before_trace, self);
for(i = 0 ; i < nb_tracefile ; i++) {
tfc = &g_array_index(self->tracefiles, LttvTracefileContext*, i);
+ tf = (*tfc)->tf;
lttv_tracefile_context_add_hooks(*tfc,
before_tracefile,
event,
- event_by_id);
+ NULL);
+ if (event_by_id_channel) {
+ for(j = 0; j < event_by_id_channel->array->len; j++) {
+ LttvHooksByIdChannel *hooks = &g_array_index(event_by_id_channel->array,
+ LttvHooksByIdChannel, j);
+ if (tf->name == hooks->channel)
+ lttv_tracefile_context_add_hooks(*tfc,
+ NULL,
+ NULL,
+ hooks->hooks_by_id);
+ }
+ }
}
}
LttvHooks *after_trace,
LttvHooks *after_tracefile,
LttvHooks *event,
- LttvHooksById *event_by_id)
+ LttvHooksByIdChannelArray *event_by_id_channel)
{
- guint i, nb_tracefile;
-
+ guint i, j, nb_tracefile;
LttvTracefileContext **tfc;
+ LttTracefile *tf;
nb_tracefile = self->tracefiles->len;
for(i = 0 ; i < nb_tracefile ; i++) {
tfc = &g_array_index(self->tracefiles, LttvTracefileContext*, i);
+ tf = (*tfc)->tf;
+ if (event_by_id_channel) {
+ for(j = 0; j < event_by_id_channel->array->len; j++) {
+ LttvHooksByIdChannel *hooks = &g_array_index(event_by_id_channel->array,
+ LttvHooksByIdChannel, j);
+ if (tf->name == hooks->channel)
+ lttv_tracefile_context_remove_hooks(*tfc,
+ NULL,
+ NULL,
+ hooks->hooks_by_id);
+ }
+ }
lttv_tracefile_context_remove_hooks(*tfc,
- after_tracefile,
- event,
- event_by_id);
+ after_tracefile,
+ event,
+ NULL);
+
}
lttv_hooks_call(after_trace, self);
LttvHooksById *event_by_id)
{
guint i, index;
-
LttvHooks *hook;
lttv_hooks_call(before_tracefile, self);
lttv_hooks_call(after_tracefile, self);
}
-
-
-void lttv_tracefile_context_add_hooks_by_id(LttvTracefileContext *tfc,
- unsigned i,
- LttvHooks *event_by_id)
-{
- LttvHooks * h;
- h = lttv_hooks_by_id_find(tfc->event_by_id, i);
- lttv_hooks_add_list(h, event_by_id);
-}
-
-void lttv_tracefile_context_remove_hooks_by_id(LttvTracefileContext *tfc,
- unsigned i)
-{
- lttv_hooks_by_id_remove(tfc->event_by_id, i);
-}
-
static LttvTracesetContext *
new_traceset_context(LttvTracesetContext *self)
{
LttvHooks *before_trace,
LttvHooks *before_tracefile,
LttvHooks *event,
- LttvHooksById *event_by_id)
+ LttvHooksByIdChannelArray *event_by_id_channel)
{
/* simply add hooks in context. _before hooks are called by add_hooks. */
before_trace,
before_tracefile,
event,
- event_by_id);
+ event_by_id_channel);
}
LttvHooks *after_trace,
LttvHooks *after_tracefile,
LttvHooks *event,
- LttvHooksById *event_by_id)
+ LttvHooksByIdChannelArray *event_by_id_channel)
{
/* Remove hooks from context. _after hooks are called by remove_hooks. */
/* It calls all after_traceset, after_trace, and after_tracefile hooks. */
after_trace,
after_tracefile,
event,
- event_by_id);
+ event_by_id_channel);
}
/* Subtile modification :
struct marker_info *lttv_trace_hook_get_marker(LttTrace *t, LttvTraceHook *th)
{
- return marker_get_info_from_id(t, th->id);
+ return marker_get_info_from_id(th->mdata, th->id);
}
-int lttv_trace_find_hook(LttTrace *t, GQuark facility_name, GQuark event_name,
+int lttv_trace_find_hook(LttTrace *t, GQuark channel_name, GQuark event_name,
GQuark fields[], LttvHook h, gpointer hook_data, GArray **trace_hooks)
{
struct marker_info *info;
guint16 marker_id;
int init_array_size;
- GQuark marker_name;
+ GArray *group;
+ struct marker_data *mdata;
- marker_name = lttv_merge_facility_event_name(facility_name, event_name);
+ group = g_datalist_id_get_data(&t->tracefiles, channel_name);
+ if (unlikely(!group || group->len == 0)) {
+ g_warning("No channel for marker named %s.%s found",
+ g_quark_to_string(channel_name), g_quark_to_string(event_name));
+ return 1;
+ }
- info = marker_get_info_from_name(t, marker_name);
+ mdata = g_array_index (group, LttTracefile, 0).mdata;
+ info = marker_get_info_from_name(mdata, event_name);
if(unlikely(info == NULL)) {
- g_warning("No marker of name %s found", g_quark_to_string(marker_name));
+ g_warning("No marker named %s.%s found",
+ g_quark_to_string(channel_name), g_quark_to_string(event_name));
return 1;
}
GQuark *f;
struct marker_field *marker_field;
- marker_id = marker_get_id_from_info(t, info);
+ marker_id = marker_get_id_from_info(mdata, info);
tmpth.h = h;
+ tmpth.mdata = mdata;
+ tmpth.channel = channel_name;
tmpth.id = marker_id;
tmpth.hook_data = hook_data;
tmpth.fields = g_ptr_array_new();
marker. Print a warning and skip this marker completely.
Still iterate on other markers with same name. */
g_ptr_array_free(tmpth.fields, TRUE);
- g_warning("Field %s cannot be found in marker %s",
- g_quark_to_string(*f), g_quark_to_string(marker_name));
+ g_warning("Field %s cannot be found in marker %s.%s",
+ g_quark_to_string(*f), g_quark_to_string(channel_name),
+ g_quark_to_string(event_name));
goto skip_marker;
}
}
/* Error if no new trace hook has been added */
if (init_array_size == (*trace_hooks)->len) {
- g_warning("No marker of name %s has all requested fields",
- g_quark_to_string(marker_name));
+ g_warning("No marker of name %s.%s has all requested fields",
+ g_quark_to_string(channel_name), g_quark_to_string(event_name));
return 1;
}
return 0;
void lttv_process_traceset_begin(LttvTracesetContext *self,
- LttvHooks *before_traceset,
- LttvHooks *before_trace,
- LttvHooks *before_tracefile,
- LttvHooks *event,
- LttvHooksById *event_by_id);
+ LttvHooks *before_traceset,
+ LttvHooks *before_trace,
+ LttvHooks *before_tracefile,
+ LttvHooks *event,
+ LttvHooksByIdChannelArray *event_by_id_channel);
guint lttv_process_traceset_middle(LttvTracesetContext *self,
const LttvTracesetContextPosition *end_position);
void lttv_process_traceset_end(LttvTracesetContext *self,
- LttvHooks *after_traceset,
- LttvHooks *after_trace,
- LttvHooks *after_tracefile,
- LttvHooks *event,
- LttvHooksById *event_by_id);
+ LttvHooks *after_traceset,
+ LttvHooks *after_trace,
+ LttvHooks *after_tracefile,
+ LttvHooks *event,
+ LttvHooksByIdChannelArray *event_by_id_channel);
void lttv_process_traceset_seek_time(LttvTracesetContext *self, LttTime start);
LttvHooks *before_trace,
LttvHooks *before_tracefile,
LttvHooks *event,
- LttvHooksById *event_by_id);
+ LttvHooksByIdChannelArray *event_by_id_channel);
void lttv_traceset_context_remove_hooks(LttvTracesetContext *self,
LttvHooks *after_traceset,
LttvHooks *after_trace,
LttvHooks *after_tracefile,
LttvHooks *event,
- LttvHooksById *event_by_id);
+ LttvHooksByIdChannelArray *event_by_id_channel);
void lttv_trace_context_add_hooks(LttvTraceContext *self,
LttvHooks *before_trace,
LttvHooks *before_tracefile,
LttvHooks *event,
- LttvHooksById *event_by_id);
+ LttvHooksByIdChannelArray *event_by_id_channel);
void lttv_trace_context_remove_hooks(LttvTraceContext *self,
LttvHooks *after_trace,
LttvHooks *after_tracefile,
LttvHooks *event,
- LttvHooksById *event_by_id);
+ LttvHooksByIdChannelArray *event_by_id_channel);
void lttv_tracefile_context_add_hooks(LttvTracefileContext *self,
LttvHooks *before_tracefile,
void lttv_tracefile_context_remove_hooks(LttvTracefileContext *self,
- LttvHooks *after_tracefile,
- LttvHooks *event,
- LttvHooksById *event_by_id);
-
-
-void lttv_tracefile_context_add_hooks_by_id(LttvTracefileContext *self,
- unsigned i,
- LttvHooks *event_by_id);
-
-void lttv_tracefile_context_remove_hooks_by_id(LttvTracefileContext *self,
- unsigned i);
+ LttvHooks *after_tracefile,
+ LttvHooks *event,
+ LttvHooksById *event_by_id);
typedef struct _LttvTraceHook {
LttvHook h;
+ struct marker_data *mdata;
+ GQuark channel;
guint16 id; /* id of the marker associated with this hook */
GPtrArray *fields; /* struct marker_fields pointers */
gpointer hook_data;
return g_ptr_array_index(hook->fields, index);
}
+#if 0
static inline GQuark lttv_merge_facility_event_name(GQuark fac, GQuark ev)
{
char *tmp;
g_free(tmp);
return ret;
}
+#endif //0
LttvTracefileContext *lttv_traceset_context_get_current_tfc(
LttvTracesetContext *self);
# WARNING : subdirs order is important : mainWin depends on API
-SUBDIRS = lttvwindow controlflow detailedevents statistics filter tracecontrol resourceview histogram interrupts
+SUBDIRS = lttvwindow controlflow detailedevents statistics filter tracecontrol histogram interrupts resourceview
# TODO: PORT for 0.10
#diskperformance tutorial
AM_CFLAGS += $(GTK_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
LIBS += $(GLIB_LIBS)
+LIBS += $(THREAD_LIBS)
LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
libdir = ${lttvplugindir}
GArray *hooks;
- LttvTraceHook *hook;
-
LttvTraceHook *th;
guint ret;
EventsRequest *events_request = g_new(EventsRequest, 1);
// Create the hooks
//LttvHooks *event = lttv_hooks_new();
- LttvHooksById *event_by_id = lttv_hooks_by_id_new();
+ LttvHooksByIdChannelArray *event_by_id_channel =
+ lttv_hooks_by_id_channel_new();
LttvHooks *before_chunk_traceset = lttv_hooks_new();
LttvHooks *after_chunk_traceset = lttv_hooks_new();
LttvHooks *before_request_hook = lttv_hooks_new();
/* before hooks */
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SYSCALL_ENTRY,
FIELD_ARRAY(LTT_FIELD_SYSCALL_ID),
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SYSCALL_EXIT,
NULL,
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_TRAP_ENTRY,
FIELD_ARRAY(LTT_FIELD_TRAP_ID),
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_TRAP_EXIT,
NULL,
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_IRQ_ID),
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_EXIT,
NULL,
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_SOFT_IRQ_ID),
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_EXIT,
NULL,
before_execmode_hook,
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SCHED_SCHEDULE,
FIELD_ARRAY(LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE),
before_schedchange_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_PROCESS_EXIT,
FIELD_ARRAY(LTT_FIELD_PID),
before_process_exit_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_PROCESS_FREE,
FIELD_ARRAY(LTT_FIELD_PID),
before_process_release_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_LIST,
+ LTT_CHANNEL_GLOBAL_STATE,
LTT_EVENT_STATEDUMP_END,
NULL,
before_statedump_end,
first_after = hooks->len;
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SCHED_SCHEDULE,
FIELD_ARRAY(LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE),
after_schedchange_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_PROCESS_FORK,
FIELD_ARRAY(LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID),
after_process_fork_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_PROCESS_EXIT,
FIELD_ARRAY(LTT_FIELD_PID),
after_process_exit_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_FS,
+ LTT_CHANNEL_FS,
LTT_EVENT_EXEC,
NULL,
after_fs_exec_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_USER_GENERIC,
+ LTT_CHANNEL_USERSPACE,
LTT_EVENT_THREAD_BRAND,
FIELD_ARRAY(LTT_FIELD_NAME),
after_user_generic_thread_brand_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_LIST,
+ LTT_CHANNEL_TASK_STATE,
LTT_EVENT_PROCESS_STATE,
FIELD_ARRAY(LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME),
after_event_enum_process_hook,
&hooks);
- /* Add these hooks to each event_by_id hooks list */
+ /* Add these hooks to each event_by_id_channel hooks list */
/* add before */
for(k = 0 ; k < first_after ; k++) {
th = &g_array_index(hooks, LttvTraceHook, k);
- lttv_hooks_add(lttv_hooks_by_id_find(event_by_id, th->id),
+ lttv_hooks_add(lttv_hooks_by_id_channel_find(event_by_id_channel,
+ th->channel, th->id),
th->h,
th,
LTTV_PRIO_STATE-5);
/* add after */
for(k = first_after ; k < hooks->len ; k++) {
th = &g_array_index(hooks, LttvTraceHook, k);
- lttv_hooks_add(lttv_hooks_by_id_find(event_by_id, th->id),
+ lttv_hooks_add(lttv_hooks_by_id_channel_find(event_by_id_channel,
+ th->channel, th->id),
th->h,
th,
LTTV_PRIO_STATE+5);
events_request->before_chunk_trace = NULL;
events_request->before_chunk_tracefile = NULL;
events_request->event = NULL;
- events_request->event_by_id = event_by_id;
+ events_request->event_by_id_channel = event_by_id_channel;
events_request->after_chunk_tracefile = NULL;
events_request->after_chunk_trace = NULL;
events_request->after_chunk_traceset = after_chunk_traceset;
AM_CFLAGS += $(GTK_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
LIBS += $(GLIB_LIBS)
+LIBS += $(THREAD_LIBS)
LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
libdir = ${lttvplugindir}
TRACE_NAME_COLUMN, g_quark_to_string(ltt_trace_name(tfc->t_context->t)),
TRACEFILE_NAME_COLUMN, g_quark_to_string(ltt_tracefile_name(tfc->tf)),
CPUID_COLUMN, cpu,
- EVENT_COLUMN, g_quark_to_string(marker_get_info_from_id(tfc->t_context->t, e->event_id)->name),
+ EVENT_COLUMN, g_quark_to_string(marker_get_info_from_id(tfc->tf->mdata,
+ e->event_id)->name),
TIME_S_COLUMN, time.tv_sec,
TIME_NS_COLUMN, time.tv_nsec,
PID_COLUMN, process->pid,
AM_CFLAGS += $(GTK_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
LIBS += $(GLIB_LIBS)
+LIBS += $(THREAD_LIBS)
LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
libdir = ${lttvplugindir}
GArray *disk_array;
- LttvHooksById * event_by_id_hooks;
+ LttvHooksByIdChannelArray * event_by_id_hooks;
} DiskPerformanceData;
/* Get a trace state */
ts = (LttvTraceState *)tsc->traces[i];
- disk_performance->event_by_id_hooks = lttv_hooks_by_id_new();
+ disk_performance->event_by_id_hooks = lttv_hooks_by_id_channel_new();
/* Register event_by_id_hooks with a callback function */
ret = lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_BLOCK, LTT_EVENT_BLOCK_READ,
+ LTT_CHANNEL_BLOCK, LTT_EVENT_BLOCK_READ,
0, 0, 0,
block_read_callback,
disk_performance,
&g_array_index(hooks, LttvTraceHook, 0));
ret = lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_BLOCK, LTT_EVENT_BLOCK_WRITE,
+ LTT_CHANNEL_BLOCK, LTT_EVENT_BLOCK_WRITE,
0, 0, 0,
block_write_callback,
disk_performance,
for(l=0; l<hook->fac_list->len; l++)
{
thf = g_array_index(hook->fac_list, LttvTraceHookByFacility*, l);
- lttv_hooks_add(lttv_hooks_by_id_find(disk_performance->event_by_id_hooks, thf->id),
+ lttv_hooks_add(lttv_hooks_by_id_channel_find(
+ disk_performance->event_by_id_hooks,
+ thf->channel, thf->id),
thf->h,
disk_performance,
LTTV_PRIO_DEFAULT);
events_request->before_chunk_trace = disk_performance->hooks_trace_before;
events_request->before_chunk_tracefile= NULL;
events_request->event = NULL;
- events_request->event_by_id = disk_performance->event_by_id_hooks;
+ events_request->event_by_id_channel = disk_performance->event_by_id_hooks;
events_request->after_chunk_tracefile = NULL;
events_request->after_chunk_trace = NULL;
events_request->after_chunk_traceset = NULL;
AM_CFLAGS = $(GLIB_CFLAGS)
AM_CFLAGS += $(GTK_CFLAGS)
+LIBS += $(THREAD_LIBS)
AM_CFLAGS += -fvisibility=hidden
LIBS += $(GLIB_LIBS)
LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
AM_CFLAGS += $(GTK_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
LIBS += $(GLIB_LIBS)
+LIBS += $(THREAD_LIBS)
LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
libdir = ${lttvplugindir}
histo_events_request->before_chunk_trace = NULL;
histo_events_request->before_chunk_tracefile= NULL;
histo_events_request->event = histo_count_event_hooks;
- histo_events_request->event_by_id = NULL;//histo_event_by_id;//NULL;
+ histo_events_request->event_by_id_channel = NULL;//histo_event_by_id;//NULL;
histo_events_request->after_chunk_tracefile = NULL;
histo_events_request->after_chunk_trace = NULL;
histo_events_request->after_chunk_traceset = histo_after_chunk_traceset;//NULL;
AM_CFLAGS += $(GTK_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
LIBS += $(GLIB_LIBS)
+LIBS += $(THREAD_LIBS)
LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
libdir = ${lttvplugindir}
LttvHooks * hooks_trace_after;
LttvHooks * hooks_trace_before;
TimeWindow time_window;
- LttvHooksById * event_by_id_hooks;
+ LttvHooksByIdChannelArray * event_by_id_hooks;
GArray *FirstRequestIrqExit;
GArray *FirstRequestIrqEntry;
GArray *SecondRequestIrqEntry;
/* Get a trace state */
ts = (LttvTraceState *)tsc->traces[i];
/* Create event_by_Id hooks */
- event_data->event_by_id_hooks = lttv_hooks_by_id_new();
+ event_data->event_by_id_hooks = lttv_hooks_by_id_channel_new();
/*Register event_by_id_hooks with a callback function*/
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_IRQ_ID),
FirstRequestIrqEntryCallback,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_EXIT,
NULL,
FirstRequestIrqExitCallback,
for(k = 0 ; k < hooks->len; k++)
{
th = &g_array_index(hooks, LttvTraceHook, k);
- lttv_hooks_add(lttv_hooks_by_id_find(event_data->event_by_id_hooks, th->id),
+ lttv_hooks_add(lttv_hooks_by_id_channel_find(
+ event_data->event_by_id_hooks,
+ th->channel, th->id),
th->h,
th,
LTTV_PRIO_DEFAULT);
events_request->before_chunk_trace = event_data->hooks_trace_before;
events_request->before_chunk_tracefile= NULL;
events_request->event = NULL;
- events_request->event_by_id = event_data->event_by_id_hooks;
+ events_request->event_by_id_channel = event_data->event_by_id_hooks;
events_request->after_chunk_tracefile = NULL;
events_request->after_chunk_trace = NULL;
events_request->after_chunk_traceset = NULL;
/* Get a trace state */
ts = (LttvTraceState *)tsc->traces[i];
/* Create event_by_Id hooks */
- event_data->event_by_id_hooks = lttv_hooks_by_id_new();
+ event_data->event_by_id_hooks = lttv_hooks_by_id_channel_new();
/*Register event_by_id_hooks with a callback function*/
ret = lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_IRQ_ID),
SecondRequestIrqEntryCallback,
&hooks);
ret = lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_EXIT,
NULL,
SecondRequestIrqExitCallback,
for(k = 0 ; k < hooks->len; k++)
{
th = &g_array_index(hooks, LttvTraceHook, k);
- lttv_hooks_add(lttv_hooks_by_id_find(event_data->event_by_id_hooks, th->id),
+ lttv_hooks_add(lttv_hooks_by_id_channel_find(
+ event_data->event_by_id_hooks,
+ th->channel, th->id),
th->h,
th,
LTTV_PRIO_DEFAULT);
events_request->before_chunk_trace = NULL;
events_request->before_chunk_tracefile= NULL;
events_request->event = NULL;
- events_request->event_by_id = event_data->event_by_id_hooks;
+ events_request->event_by_id_channel = event_data->event_by_id_hooks;
events_request->after_chunk_tracefile = NULL;
events_request->after_chunk_trace = NULL;
events_request->after_chunk_traceset = NULL;
AM_CFLAGS += $(GTK_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
LIBS += $(GLIB_LIBS)
+LIBS += $(THREAD_LIBS)
LIBS += $(GTK_LIBS)
INCLUDES = \
events_request->before_chunk_trace,
events_request->before_chunk_tracefile,
events_request->event,
- events_request->event_by_id);
+ events_request->event_by_id_channel);
else {
guint nb_trace = lttv_traceset_number(tsc->ts);
g_assert((guint)events_request->trace < nb_trace &&
events_request->before_chunk_trace,
events_request->before_chunk_tracefile,
events_request->event,
- events_request->event_by_id);
+ events_request->event_by_id_channel);
}
}
}
events_request->before_chunk_trace,
events_request->before_chunk_tracefile,
events_request->event,
- events_request->event_by_id);
+ events_request->event_by_id_channel);
else {
guint nb_trace = lttv_traceset_number(tsc->ts);
g_assert((guint)events_request->trace < nb_trace &&
events_request->before_chunk_trace,
events_request->before_chunk_tracefile,
events_request->event,
- events_request->event_by_id);
+ events_request->event_by_id_channel);
}
iter = g_slist_next(iter);
events_request->before_chunk_trace,
events_request->before_chunk_tracefile,
events_request->event,
- events_request->event_by_id);
+ events_request->event_by_id_channel);
else {
guint nb_trace = lttv_traceset_number(tsc->ts);
g_assert((guint)events_request->trace < nb_trace &&
events_request->before_chunk_trace,
events_request->before_chunk_tracefile,
events_request->event,
- events_request->event_by_id);
+ events_request->event_by_id_channel);
}
events_request->after_chunk_trace,
events_request->after_chunk_tracefile,
events_request->event,
- events_request->event_by_id);
+ events_request->event_by_id_channel);
else {
guint nb_trace = lttv_traceset_number(tsc->ts);
events_request->after_chunk_trace,
events_request->after_chunk_tracefile,
events_request->event,
- events_request->event_by_id);
+ events_request->event_by_id_channel);
lttv_hooks_call(events_request->after_chunk_traceset, tsc);
events_request->after_chunk_trace,
events_request->after_chunk_tracefile,
events_request->event,
- events_request->event_by_id);
+ events_request->event_by_id_channel);
else {
guint nb_trace = lttv_traceset_number(tsc->ts);
events_request->after_chunk_trace,
events_request->after_chunk_tracefile,
events_request->event,
- events_request->event_by_id);
+ events_request->event_by_id_channel);
lttv_hooks_call(events_request->after_chunk_traceset, tsc);
}
LTTV_BEFORE_REQUEST,
LTTV_AFTER_REQUEST,
LTTV_EVENT_HOOK,
- LTTV_EVENT_HOOK_BY_ID,
+ LTTV_EVENT_HOOK_BY_ID_CHANNEL,
LTTV_HOOK_ADDER,
LTTV_HOOK_REMOVER,
LTTV_IN_PROGRESS,
LTTV_BEFORE_REQUEST = g_quark_from_string("before_request");
LTTV_AFTER_REQUEST = g_quark_from_string("after_request");
LTTV_EVENT_HOOK = g_quark_from_string("event_hook");
- LTTV_EVENT_HOOK_BY_ID = g_quark_from_string("event_hook_by_id");
+ LTTV_EVENT_HOOK_BY_ID_CHANNEL = g_quark_from_string("event_hook_by_id_channel");
LTTV_HOOK_ADDER = g_quark_from_string("hook_adder");
LTTV_HOOK_REMOVER = g_quark_from_string("hook_remover");
LTTV_IN_PROGRESS = g_quark_from_string("in_progress");
lttv_hooks_destroy(events_request->before_chunk_tracefile);
if(events_request->event != NULL)
lttv_hooks_destroy(events_request->event);
- if(events_request->event_by_id != NULL)
- lttv_hooks_by_id_destroy(events_request->event_by_id);
+ if(events_request->event_by_id_channel != NULL)
+ lttv_hooks_by_id_channel_destroy(events_request->event_by_id_channel);
if(events_request->after_chunk_tracefile != NULL)
lttv_hooks_destroy(events_request->after_chunk_tracefile);
if(events_request->after_chunk_trace != NULL)
- a stop_flag, ending the read process when set to TRUE
- a end timestamp and/or position and/or number of events to read
- hook lists to call for traceset/trace/tracefile begin and end, and for each
- event (event hooks and event_by_id hooks).
+ event (event hooks and event_by_id_channel hooks).
The main window will deliver events for every EventRequests it has
pending through an algorithm that guarantee that all events requested,
LttvHooks *before_chunk_trace; /* Unset : NULL */
LttvHooks *before_chunk_tracefile;/* Unset : NULL */
LttvHooks *event; /* Unset : NULL */
- LttvHooksById *event_by_id; /* Unset : NULL */
+ LttvHooksByIdChannelArray *event_by_id_channel;/* Unset : NULL */
LttvHooks *after_chunk_tracefile; /* Unset : NULL */
LttvHooks *after_chunk_trace; /* Unset : NULL */
LttvHooks *after_chunk_traceset; /* Unset : NULL */
LttvHooks *before_chunk_trace=NULL;
LttvHooks *before_chunk_tracefile=NULL;
LttvHooks *event_hook=NULL;
- LttvHooksById *event_hook_by_id=NULL;
+ LttvHooksByIdChannelArray *event_hook_by_id_channel=NULL;
module_attribute =
}
type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(module_attribute),
- LTTV_EVENT_HOOK_BY_ID,
+ LTTV_EVENT_HOOK_BY_ID_CHANNEL,
&value);
if(type == LTTV_POINTER) {
- event_hook_by_id = (LttvHooksById*)*(value.v_pointer);
+ event_hook_by_id_channel = (LttvHooksById*)*(value.v_pointer);
}
lttv_process_traceset_begin(tsc,
before_chunk_trace,
before_chunk_tracefile,
event_hook,
- event_hook_by_id);
+ event_hook_by_id_channel);
}
LttvHooks *after_chunk_trace=NULL;
LttvHooks *after_chunk_tracefile=NULL;
LttvHooks *event_hook=NULL;
- LttvHooksById *event_hook_by_id=NULL;
+ LttvHooksById *event_hook_by_id_channel=NULL;
module_attribute =
LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(g_attribute),
}
type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(module_attribute),
- LTTV_EVENT_HOOK_BY_ID,
+ LTTV_EVENT_HOOK_BY_ID_CHANNEL,
&value);
if(type == LTTV_POINTER) {
- event_hook_by_id = (LttvHooksById*)*(value.v_pointer);
+ event_hook_by_id_channel = (LttvHooksById*)*(value.v_pointer);
}
lttv_process_traceset_end(tsc,
after_chunk_trace,
after_chunk_tracefile,
event_hook,
- event_hook_by_id);
+ event_hook_by_id_channel);
}
* information.
*/
void lttvwindowtraces_register_computation_hooks(LttvAttributeName module_name,
- LttvHooks *before_chunk_traceset,
- LttvHooks *before_chunk_trace,
- LttvHooks *before_chunk_tracefile,
- LttvHooks *after_chunk_traceset,
- LttvHooks *after_chunk_trace,
- LttvHooks *after_chunk_tracefile,
- LttvHooks *before_request,
- LttvHooks *after_request,
- LttvHooks *event_hook,
- LttvHooksById *event_hook_by_id,
- LttvHooks *hook_adder,
- LttvHooks *hook_remover)
+ LttvHooks *before_chunk_traceset,
+ LttvHooks *before_chunk_trace,
+ LttvHooks *before_chunk_tracefile,
+ LttvHooks *after_chunk_traceset,
+ LttvHooks *after_chunk_trace,
+ LttvHooks *after_chunk_tracefile,
+ LttvHooks *before_request,
+ LttvHooks *after_request,
+ LttvHooks *event_hook,
+ LttvHooksById *event_hook_by_id_channel,
+ LttvHooks *hook_adder,
+ LttvHooks *hook_remover)
{
LttvAttribute *g_attribute = lttv_global_attributes();
LttvAttribute *attribute;
*(value.v_pointer) = event_hook;
result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
- LTTV_EVENT_HOOK_BY_ID,
+ LTTV_EVENT_HOOK_BY_ID_CHANNEL,
LTTV_POINTER,
&value);
g_assert(result);
- *(value.v_pointer) = event_hook_by_id;
+ *(value.v_pointer) = event_hook_by_id_channel;
result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
LTTV_HOOK_ADDER,
lttv_hooks_destroy(event_hook);
result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
- LTTV_EVENT_HOOK_BY_ID,
+ LTTV_EVENT_HOOK_BY_ID_CHANNEL,
LTTV_POINTER,
&value);
g_assert(result);
- LttvHooksById *event_hook_by_id = (LttvHooksById*)*(value.v_pointer);
- if(event_hook_by_id != NULL)
- lttv_hooks_by_id_destroy(event_hook_by_id);
+ LttvHooksById *event_hook_by_id_channel = (LttvHooksById*)*(value.v_pointer);
+ if(event_hook_by_id_channel != NULL)
+ lttv_hooks_by_id_channel_destroy(event_hook_by_id_channel);
result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
LTTV_HOOK_ADDER,
lttv_iattribute_remove_by_name(LTTV_IATTRIBUTE(attribute),
- LTTV_EVENT_HOOK_BY_ID);
+ LTTV_EVENT_HOOK_BY_ID_CHANNEL);
lttv_iattribute_remove_by_name(LTTV_IATTRIBUTE(attribute),
LTTV_EVENT_HOOK);
LTTV_BEFORE_REQUEST,
LTTV_AFTER_REQUEST,
LTTV_EVENT_HOOK,
- LTTV_EVENT_HOOK_BY_ID,
+ LTTV_EVENT_HOOK_BY_ID_CHANNEL,
LTTV_HOOK_ADDER,
LTTV_HOOK_REMOVER,
LTTV_IN_PROGRESS,
AM_CFLAGS += $(GTK_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
LIBS += $(GLIB_LIBS)
+LIBS += $(THREAD_LIBS)
LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
libdir = ${lttvplugindir}
EventsRequest *events_request = g_new(EventsRequest, 1);
// Create the hooks
//LttvHooks *event = lttv_hooks_new();
- LttvHooksById *event_by_id = lttv_hooks_by_id_new();
+ LttvHooksByIdChannelArray *event_by_id_channel =
+ lttv_hooks_by_id_channel_new();
LttvHooks *before_chunk_traceset = lttv_hooks_new();
LttvHooks *after_chunk_traceset = lttv_hooks_new();
LttvHooks *before_request_hook = lttv_hooks_new();
// &hooks);
//
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_TRAP_ENTRY,
FIELD_ARRAY(LTT_FIELD_TRAP_ID),
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_TRAP_EXIT,
NULL,
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_IRQ_ID),
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_IRQ_EXIT,
NULL,
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_RAISE,
FIELD_ARRAY(LTT_FIELD_SOFT_IRQ_ID),
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_ENTRY,
FIELD_ARRAY(LTT_FIELD_SOFT_IRQ_ID),
before_execmode_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SOFT_IRQ_EXIT,
NULL,
before_execmode_hook,
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SCHED_SCHEDULE,
FIELD_ARRAY(LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE),
before_schedchange_hook,
&hooks);
// lttv_trace_find_hook(ts->parent.t,
-// LTT_FACILITY_KERNEL,
+// LTT_CHANNEL_KERNEL,
// LTT_EVENT_PROCESS_EXIT,
// FIELD_ARRAY(LTT_FIELD_PID),
// before_process_exit_hook,
// &hooks);
//
// lttv_trace_find_hook(ts->parent.t,
-// LTT_FACILITY_KERNEL,
+// LTT_CHANNEL_KERNEL,
// LTT_EVENT_PROCESS_FREE,
// FIELD_ARRAY(LTT_FIELD_PID),
// before_process_release_hook,
// &hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_BLOCK,
LTT_EVENT_REQUEST_ISSUE,
FIELD_ARRAY(LTT_FIELD_MAJOR, LTT_FIELD_MINOR, LTT_FIELD_OPERATION),
before_bdev_event_hook,
&hooks);
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_BLOCK,
LTT_EVENT_REQUEST_COMPLETE,
FIELD_ARRAY(LTT_FIELD_MAJOR, LTT_FIELD_MINOR, LTT_FIELD_OPERATION),
before_bdev_event_hook,
first_after = hooks->len;
lttv_trace_find_hook(ts->parent.t,
- LTT_FACILITY_KERNEL,
+ LTT_CHANNEL_KERNEL,
LTT_EVENT_SCHED_SCHEDULE,
FIELD_ARRAY(LTT_FIELD_PREV_PID, LTT_FIELD_NEXT_PID, LTT_FIELD_PREV_STATE),
after_schedchange_hook,
&hooks);
// lttv_trace_find_hook(ts->parent.t,
-// LTT_FACILITY_KERNEL,
+// LTT_CHANNEL_KERNEL,
// LTT_EVENT_PROCESS_FORK,
// FIELD_ARRAY(LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID),
// after_process_fork_hook,
// &hooks);
//
// lttv_trace_find_hook(ts->parent.t,
-// LTT_FACILITY_KERNEL,
+// LTT_CHANNEL_KERNEL,
// LTT_EVENT_PROCESS_EXIT,
// FIELD_ARRAY(LTT_FIELD_PID),
// after_process_exit_hook,
// &hooks);
//
// lttv_trace_find_hook(ts->parent.t,
-// LTT_FACILITY_KERNEL,
+// LTT_CHANNEL_KERNEL,
// LTT_EVENT_EXEC,
// NULL,
// after_fs_exec_hook,
/* add before */
for(k = 0 ; k < first_after ; k++) {
th = &g_array_index(hooks, LttvTraceHook, k);
- lttv_hooks_add(lttv_hooks_by_id_find(event_by_id, th->id),
- th->h,
- th,
- LTTV_PRIO_STATE-5);
+ lttv_hooks_add(lttv_hooks_by_id_channel_find(event_by_id_channel,
+ th->channel, th->id),
+ th->h,
+ th,
+ LTTV_PRIO_STATE-5);
}
/* add after */
for(k = first_after ; k < hooks->len ; k++) {
th = &g_array_index(hooks, LttvTraceHook, k);
- lttv_hooks_add(lttv_hooks_by_id_find(event_by_id, th->id),
- th->h,
- th,
- LTTV_PRIO_STATE+5);
+ lttv_hooks_add(lttv_hooks_by_id_channel_find(event_by_id_channel,
+ th->channel, th->id),
+ th->h,
+ th,
+ LTTV_PRIO_STATE+5);
}
events_request->hooks = hooks;
events_request->before_chunk_trace = NULL;
events_request->before_chunk_tracefile = NULL;
events_request->event = NULL;
- events_request->event_by_id = event_by_id;
+ events_request->event_by_id_channel = event_by_id_channel;
events_request->after_chunk_tracefile = NULL;
events_request->after_chunk_trace = NULL;
events_request->after_chunk_traceset = after_chunk_traceset;
{
//ResourceInfo *process_info = (ResourceInfo*)key;
HashedResourceData *hashed_process_data = (HashedResourceData*)value;
- guint x = (guint)user_data;
+ guint x = (guint)(gulong)user_data;
hashed_process_data->x.over = x;
hashed_process_data->x.over_used = FALSE;
for(i=0; i<RV_RESOURCE_COUNT; i++) {
g_hash_table_foreach(cfd->process_list->restypes[i].hash_table, set_last_start,
- (gpointer)x);
+ (gpointer)(gulong)x);
}
}
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;
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, 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, 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_ENTRY or LTT_EVENT_TRAP_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) {
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) {
trap = ts->cpu_states[cpu].last_trap;
- }
- else {
+ } else
return 0;
- }
guint trace_num = ts->parent.index;
void legend_destructor(GtkWindow *legend);
+ControlFlowData *resourceview(LttvPluginTab *ptab);
+
+HashedResourceData *resourcelist_obtain_cpu(ControlFlowData *resourceview_data,
+ guint trace_num, guint id);
+
+HashedResourceData *resourcelist_obtain_irq(ControlFlowData *resourceview_data,
+ guint trace_num, guint id);
+
+HashedResourceData *resourcelist_obtain_soft_irq(
+ ControlFlowData *resourceview_data, guint trace_num, guint id);
+
+HashedResourceData *resourcelist_obtain_trap(ControlFlowData *resourceview_data,
+ guint trace_num, guint id);
+
+HashedResourceData *resourcelist_obtain_bdev(ControlFlowData *resourceview_data,
+ guint trace_num, guint id);
+
#endif // _EVENT_HOOKS_H
AM_CFLAGS += $(GTK_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
LIBS += $(GLIB_LIBS)
+LIBS += $(THREAD_LIBS)
LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
libdir = ${lttvplugindir}
AM_CFLAGS += -DPACKAGE_DATA_DIR=\""$(datadir)"\" -DPACKAGE_BIN_DIR=\""$(bindir)"\"
AM_CFLAGS += -fvisibility=hidden
LIBS += $(GLIB_LIBS)
+LIBS += $(THREAD_LIBS)
LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
LIBS += $(UTIL_LIBS)
AM_CFLAGS += $(GTK_CFLAGS)
AM_CFLAGS += -fvisibility=hidden
LIBS += $(GLIB_LIBS)
+LIBS += $(THREAD_LIBS)
LIBS += $(GTK_LIBS) -L${top_builddir}/lttv/modules/gui/lttvwindow/lttvwindow -llttvwindow
libdir = ${lttvplugindir}
AM_CFLAGS = $(GLIB_CFLAGS)
+LIBS += $(THREAD_LIBS)
LIBS += $(GLIB_LIBS) -lgobject-2.0 -L${top_builddir}/ltt -llttvtraceread
libdir = ${lttvplugindir}