X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Finclude%2Flttv%2FprocessTrace.h;h=a05aab786fcac4b1bd998e244931b773bb7895c7;hb=efde9138bd61f0ce9cabb3f2dcc0d0040eaf35ed;hp=60dfd7ba55798b773f6f2b67f8de1139cdf2bcbd;hpb=dc87756342c051418eccb2b7d932ffa5453c6788;p=lttv.git diff --git a/ltt/branches/poly/include/lttv/processTrace.h b/ltt/branches/poly/include/lttv/processTrace.h index 60dfd7ba..a05aab78 100644 --- a/ltt/branches/poly/include/lttv/processTrace.h +++ b/ltt/branches/poly/include/lttv/processTrace.h @@ -1,6 +1,25 @@ +/* This file is part of the Linux Trace Toolkit viewer + * Copyright (C) 2003-2004 Michel Dagenais + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + #ifndef PROCESSTRACE_H #define PROCESSTRACE_H +#include #include #include #include @@ -45,6 +64,16 @@ tracefile contexts may be subtyped as needed. Indeed, both the contexts and the hooks are defined by the caller. */ + +typedef struct _LttvTracesetContext LttvTracesetContext; +typedef struct _LttvTracesetContextClass LttvTracesetContextClass; + +typedef struct _LttvTraceContext LttvTraceContext; +typedef struct _LttvTraceContextClass LttvTraceContextClass; + +typedef struct _LttvTracefileContext LttvTracefileContext; +typedef struct _LttvTracefileContextClass LttvTracefileContextClass; + #define LTTV_TRACESET_CONTEXT_TYPE (lttv_traceset_context_get_type ()) #define LTTV_TRACESET_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LTTV_TRACESET_CONTEXT_TYPE, LttvTracesetContext)) #define LTTV_TRACESET_CONTEXT_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), LTTV_TRACESET_CONTEXT_TYPE, LttvTracesetContextClass)) @@ -52,9 +81,6 @@ #define LTTV_IS_TRACESET_CONTEXT_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), LTTV_TRACESET_CONTEXT_TYPE)) #define LTTV_TRACESET_CONTEXT_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), LTTV_TRACESET_CONTEXT_TYPE, LttvTracesetContextClass)) -typedef struct _LttvTracesetContext LttvTracesetContext; -typedef struct _LttvTracesetContextClass LttvTracesetContextClass; - struct _LttvTracesetContext { GObject parent; @@ -63,6 +89,8 @@ struct _LttvTracesetContext { LttvHooks *after; LttvTraceContext **traces; LttvAttribute *a; + LttvAttribute *ts_a; + TimeInterval *Time_Span; }; struct _LttvTracesetContextClass { @@ -98,21 +126,20 @@ lttv_context_new_tracefile_context(LttvTracesetContext *self); #define LTTV_IS_TRACE_CONTEXT_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), LTTV_TRACE_CONTEXT_TYPE)) #define LTTV_TRACE_CONTEXT_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), LTTV_TRACE_CONTEXT_TYPE, LttvTraceContextClass)) -typedef struct _LttvTraceContext LttvTraceContext; -typedef struct _LttvTraceContextClass LttvTraceContextClass; - struct _LttvTraceContext { GObject parent; LttvTracesetContext *ts_context; guint index; /* in ts_context->traces */ - LttvTrace *t; + LttTrace *t; + LttvTrace *vt; LttvHooks *check; LttvHooks *before; LttvHooks *after; LttvTracefileContext **control_tracefiles; LttvTracefileContext **per_cpu_tracefiles; LttvAttribute *a; + LttvAttribute *t_a; }; struct _LttvTraceContextClass { @@ -128,26 +155,23 @@ GType lttv_trace_context_get_type (void); #define LTTV_IS_TRACEFILE_CONTEXT_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), LTTV_TRACEFILE_CONTEXT_TYPE)) #define LTTV_TRACEFILE_CONTEXT_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), LTTV_TRACEFILE_CONTEXT_TYPE, LttvTracefileContextClass)) -typedef struct _LttvTracefileContext LttvTracefileContext; -typedef struct _LttvTracefileContextClass LttvTracefileContextClass; - struct _LttvTracefileContext { GObject parent; LttvTraceContext *t_context; gboolean control; guint index; /* in ts_context->control/per_cpu_tracefiles */ - LttvTracefile *tf; + LttTracefile *tf; LttvHooks *check; LttvHooks *before; LttvHooks *after; - LttvEvent *e; + LttEvent *e; LttvHooks *check_event; LttvHooks *before_event; LttvHooksById *before_event_by_id; LttvHooks *after_event; LttvHooksById *after_event_by_id; - LttTime *time; + LttTime timestamp; LttvAttribute *a; }; @@ -157,8 +181,12 @@ struct _LttvTracefileContextClass { GType lttv_tracefile_context_get_type (void); -void lttv_process_trace(LttvTime start, LttvTime end, LttvTraceset *traceset, - LttvTracesetContext *context); +void lttv_process_traceset(LttvTracesetContext *self, LttTime end, + unsigned maxNumEvents); + +void lttv_process_traceset_seek_time(LttvTracesetContext *self, LttTime start); + +void lttv_process_trace_seek_time(LttvTraceContext *self, LttTime start); void lttv_traceset_context_add_hooks(LttvTracesetContext *self, LttvHooks *before_traceset, @@ -166,9 +194,12 @@ void lttv_traceset_context_add_hooks(LttvTracesetContext *self, LttvHooks *check_trace, LttvHooks *before_trace, LttvHooks *after_trace, + LttvHooks *check_tracefile, + LttvHooks *before_tracefile, + LttvHooks *after_tracefile, LttvHooks *check_event, LttvHooks *before_event, - LttvHooks *after_event) + LttvHooks *after_event); void lttv_traceset_context_remove_hooks(LttvTracesetContext *self, LttvHooks *before_traceset, @@ -176,8 +207,64 @@ void lttv_traceset_context_remove_hooks(LttvTracesetContext *self, LttvHooks *check_trace, LttvHooks *before_trace, LttvHooks *after_trace, + LttvHooks *check_tracefile, + LttvHooks *before_tracefile, + LttvHooks *after_tracefile, LttvHooks *check_event, LttvHooks *before_event, - LttvHooks *after_event) + LttvHooks *after_event); + +void lttv_trace_context_add_hooks(LttvTraceContext *self, + LttvHooks *check_trace, + LttvHooks *before_trace, + LttvHooks *after_trace); + +void lttv_trace_context_remove_hooks(LttvTraceContext *self, + LttvHooks *check_trace, + LttvHooks *before_trace, + LttvHooks *after_trace); + +void lttv_tracefile_context_add_hooks(LttvTracefileContext *self, + LttvHooks *check_tracefile, + LttvHooks *before_tracefile, + LttvHooks *after_tracefile, + LttvHooks *check_event, + LttvHooks *before_event, + LttvHooks *after_event); + +void lttv_tracefile_context_remove_hooks(LttvTracefileContext *self, + LttvHooks *check_tracefile, + LttvHooks *before_tracefile, + LttvHooks *after_tracefile, + LttvHooks *check_event, + LttvHooks *before_event, + LttvHooks *after_event); + +void lttv_tracefile_context_add_hooks_by_id(LttvTracefileContext *self, + unsigned i, + LttvHooks *before_event_by_id, + LttvHooks *after_event_by_id); + +void lttv_tracefile_context_remove_hooks_by_id(LttvTracefileContext *self, + unsigned i); + +typedef struct _LttvTraceHook { + LttvHook h; + guint id; + LttField *f1; + LttField *f2; + LttField *f3; +} LttvTraceHook; + + +/* Search in the trace for the id of the named event type within the named + facility. Then, find the three (if non null) named fields. All that + information is then used to fill the LttvTraceHook structure. This + is useful to find the specific id for an event within a trace, for + registering a hook using this structure as event data; + it already contains the (up to three) needed fields handles. */ + +void lttv_trace_find_hook(LttTrace *t, char *facility, char *event_type, + char *field1, char *field2, char *field3, LttvHook h, LttvTraceHook *th); #endif // PROCESSTRACE_H