projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
correct bug : need EXIT and ZOMBIE states : one for exit event, the other for schedul...
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
lttv
/
tracecontext.c
diff --git
a/ltt/branches/poly/lttv/lttv/tracecontext.c
b/ltt/branches/poly/lttv/lttv/tracecontext.c
index bdd3bdc752e6e1a3a04094ffa2af1c07167321e0..e0ddd00616f8ebc88931e68210f25bfad718c075 100644
(file)
--- a/
ltt/branches/poly/lttv/lttv/tracecontext.c
+++ b/
ltt/branches/poly/lttv/lttv/tracecontext.c
@@
-16,7
+16,7
@@
* MA 02111-1307, USA.
*/
* MA 02111-1307, USA.
*/
-
+#include <string.h>
#include <lttv/tracecontext.h>
#include <ltt/event.h>
#include <ltt/facility.h>
#include <lttv/tracecontext.h>
#include <ltt/event.h>
#include <ltt/facility.h>
@@
-30,9
+30,9
@@
gint compare_tracefile(gconstpointer a, gconstpointer b)
{
gint comparison;
{
gint comparison;
-
LttvTracefileContext *trace_a = (
LttvTracefileContext *)a;
+
const LttvTracefileContext *trace_a = (const
LttvTracefileContext *)a;
-
LttvTracefileContext *trace_b = (
LttvTracefileContext *)b;
+
const LttvTracefileContext *trace_b = (const
LttvTracefileContext *)b;
if(trace_a == trace_b) return 0;
comparison = ltt_time_compare(trace_a->timestamp, trace_b->timestamp);
if(trace_a == trace_b) return 0;
comparison = ltt_time_compare(trace_a->timestamp, trace_b->timestamp);
@@
-41,7
+41,9
@@
gint compare_tracefile(gconstpointer a, gconstpointer b)
else if(trace_a->index > trace_b->index) return 1;
if(trace_a->t_context->index < trace_b->t_context->index) return -1;
else if(trace_a->t_context->index > trace_b->t_context->index) return 1;
else if(trace_a->index > trace_b->index) return 1;
if(trace_a->t_context->index < trace_b->t_context->index) return -1;
else if(trace_a->t_context->index > trace_b->t_context->index) return 1;
+
g_assert(FALSE);
g_assert(FALSE);
+ return 0; /* This should never happen */
}
struct _LttvTraceContextPosition {
}
struct _LttvTraceContextPosition {
@@
-184,6
+186,7
@@
init(LttvTracesetContext *self, LttvTraceset *ts)
tfc->tf = ltt_trace_per_cpu_tracefile_get(tc->t, j - nb_control);
}
tfc->t_context = tc;
tfc->tf = ltt_trace_per_cpu_tracefile_get(tc->t, j - nb_control);
}
tfc->t_context = tc;
+ tfc->e = ltt_event_new();
tfc->event = lttv_hooks_new();
tfc->event_by_id = lttv_hooks_by_id_new();
tfc->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
tfc->event = lttv_hooks_new();
tfc->event_by_id = lttv_hooks_by_id_new();
tfc->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
@@
-223,6
+226,7
@@
void fini(LttvTracesetContext *self)
for(j = 0 ; j < nb_tracefile ; j++) {
tfc = tc->tracefiles[j];
for(j = 0 ; j < nb_tracefile ; j++) {
tfc = tc->tracefiles[j];
+ ltt_event_destroy(tfc->e);
lttv_hooks_destroy(tfc->event);
lttv_hooks_by_id_destroy(tfc->event_by_id);
g_object_unref(tfc->a);
lttv_hooks_destroy(tfc->event);
lttv_hooks_by_id_destroy(tfc->event_by_id);
g_object_unref(tfc->a);
@@
-463,7
+467,8
@@
lttv_traceset_context_get_type(void)
NULL, /* class_data */
sizeof (LttvTracesetContext),
0, /* n_preallocs */
NULL, /* class_data */
sizeof (LttvTracesetContext),
0, /* n_preallocs */
- (GInstanceInitFunc) traceset_context_instance_init /* instance_init */
+ (GInstanceInitFunc) traceset_context_instance_init, /* instance_init */
+ NULL /* Value handling */
};
type = g_type_register_static (G_TYPE_OBJECT, "LttvTracesetContextType",
};
type = g_type_register_static (G_TYPE_OBJECT, "LttvTracesetContextType",
@@
-511,7
+516,8
@@
lttv_trace_context_get_type(void)
NULL, /* class_data */
sizeof (LttvTraceContext),
0, /* n_preallocs */
NULL, /* class_data */
sizeof (LttvTraceContext),
0, /* n_preallocs */
- (GInstanceInitFunc) trace_context_instance_init /* instance_init */
+ (GInstanceInitFunc) trace_context_instance_init, /* instance_init */
+ NULL /* Value handling */
};
type = g_type_register_static (G_TYPE_OBJECT, "LttvTraceContextType",
};
type = g_type_register_static (G_TYPE_OBJECT, "LttvTraceContextType",
@@
-559,7
+565,8
@@
lttv_tracefile_context_get_type(void)
NULL, /* class_data */
sizeof (LttvTracefileContext),
0, /* n_preallocs */
NULL, /* class_data */
sizeof (LttvTracefileContext),
0, /* n_preallocs */
- (GInstanceInitFunc) tracefile_context_instance_init /* instance_init */
+ (GInstanceInitFunc) tracefile_context_instance_init, /* instance_init */
+ NULL /* Value handling */
};
type = g_type_register_static (G_TYPE_OBJECT, "LttvTracefileContextType",
};
type = g_type_register_static (G_TYPE_OBJECT, "LttvTracefileContextType",
@@
-646,8
+653,6
@@
guint lttv_process_traceset_middle(LttvTracesetContext *self,
LttvTracefileContext *tfc;
LttvTracefileContext *tfc;
- LttEvent *event;
-
unsigned count = 0;
gboolean last_ret = FALSE; /* return value of the last hook list called */
unsigned count = 0;
gboolean last_ret = FALSE; /* return value of the last hook list called */
@@
-694,10
+699,8
@@
guint lttv_process_traceset_middle(LttvTracesetContext *self,
last_ret = lttv_hooks_call_merge(tfc->event, tfc,
lttv_hooks_by_id_get(tfc->event_by_id, id), tfc);
last_ret = lttv_hooks_call_merge(tfc->event, tfc,
lttv_hooks_by_id_get(tfc->event_by_id, id), tfc);
- event = ltt_tracefile_read(tfc->tf);
- if(event != NULL) {
- tfc->e = event;
- tfc->timestamp = ltt_event_time(event);
+ if(ltt_tracefile_read(tfc->tf, tfc->e) != NULL) {
+ tfc->timestamp = ltt_event_time(tfc->e);
g_tree_insert(pqueue, tfc, tfc);
}
}
g_tree_insert(pqueue, tfc, tfc);
}
}
@@
-727,8
+730,6
@@
void lttv_process_trace_seek_time(LttvTraceContext *self, LttTime start)
LttvTracefileContext *tfc;
LttvTracefileContext *tfc;
- LttEvent *event;
-
GTree *pqueue = self->ts_context->pqueue;
nb_tracefile = ltt_trace_control_tracefile_number(self->t) +
GTree *pqueue = self->ts_context->pqueue;
nb_tracefile = ltt_trace_control_tracefile_number(self->t) +
@@
-738,10
+739,8
@@
void lttv_process_trace_seek_time(LttvTraceContext *self, LttTime start)
tfc = self->tracefiles[i];
ltt_tracefile_seek_time(tfc->tf, start);
g_tree_remove(pqueue, tfc);
tfc = self->tracefiles[i];
ltt_tracefile_seek_time(tfc->tf, start);
g_tree_remove(pqueue, tfc);
- event = ltt_tracefile_read(tfc->tf);
- tfc->e = event;
- if(event != NULL) {
- tfc->timestamp = ltt_event_time(event);
+ if(ltt_tracefile_read(tfc->tf, tfc->e) != NULL) {
+ tfc->timestamp = ltt_event_time(tfc->e);
g_tree_insert(pqueue, tfc, tfc);
}
}
g_tree_insert(pqueue, tfc, tfc);
}
}
@@
-754,8
+753,6
@@
void lttv_process_traceset_seek_time(LttvTracesetContext *self, LttTime start)
LttvTraceContext *tc;
LttvTraceContext *tc;
- LttvTracefileContext *tfc;
-
nb_trace = lttv_traceset_number(self->ts);
for(i = 0 ; i < nb_trace ; i++) {
tc = self->traces[i];
nb_trace = lttv_traceset_number(self->ts);
for(i = 0 ; i < nb_trace ; i++) {
tc = self->traces[i];
@@
-769,20
+766,16
@@
gboolean lttv_process_tracefile_seek_position(LttvTracefileContext *self,
{
LttvTracefileContext *tfc = self;
{
LttvTracefileContext *tfc = self;
- LttEvent *event;
-
GTree *pqueue = self->t_context->ts_context->pqueue;
ltt_tracefile_seek_position(tfc->tf, pos);
g_tree_remove(pqueue, tfc);
GTree *pqueue = self->t_context->ts_context->pqueue;
ltt_tracefile_seek_position(tfc->tf, pos);
g_tree_remove(pqueue, tfc);
- event = ltt_tracefile_read(tfc->tf);
- tfc->e = event;
- if(event != NULL) {
- tfc->timestamp = ltt_event_time(event);
+ if(ltt_tracefile_read(tfc->tf, tfc->e) != NULL) {
+ tfc->timestamp = ltt_event_time(tfc->e);
g_tree_insert(pqueue, tfc, tfc);
}
g_tree_insert(pqueue, tfc, tfc);
}
-
+ return TRUE;
}
gboolean lttv_process_trace_seek_position(LttvTraceContext *self,
}
gboolean lttv_process_trace_seek_position(LttvTraceContext *self,
@@
-792,8
+785,6
@@
gboolean lttv_process_trace_seek_position(LttvTraceContext *self,
LttvTracefileContext *tfc;
LttvTracefileContext *tfc;
- LttEvent *event;
-
nb_tracefile = ltt_trace_control_tracefile_number(self->t) +
ltt_trace_per_cpu_tracefile_number(self->t);
nb_tracefile = ltt_trace_control_tracefile_number(self->t) +
ltt_trace_per_cpu_tracefile_number(self->t);
@@
-818,8
+809,6
@@
gboolean lttv_process_traceset_seek_position(LttvTracesetContext *self,
LttvTraceContext *tc;
LttvTraceContext *tc;
- LttvTracefileContext *tfc;
-
nb_trace = lttv_traceset_number(self->ts);
if(nb_trace != pos->nb_trace)
nb_trace = lttv_traceset_number(self->ts);
if(nb_trace != pos->nb_trace)
@@
-869,9
+858,7
@@
lttv_trace_find_hook(LttTrace *t, char *facility, char *event_type,
LttEventType *et;
LttEventType *et;
- guint nb, pos, i;
-
- char *name;
+ guint nb, pos;
nb = ltt_trace_facility_find(t, facility, &pos);
if(nb < 1) g_error("No %s facility", facility);
nb = ltt_trace_facility_find(t, facility, &pos);
if(nb < 1) g_error("No %s facility", facility);
@@
-937,7
+924,7
@@
void lttv_traceset_context_position_save(const LttvTracesetContext *self,
void lttv_traceset_context_position_destroy(LttvTracesetContextPosition *pos)
{
void lttv_traceset_context_position_destroy(LttvTracesetContextPosition *pos)
{
- guint nb_trace
, nb_tracefile
;
+ guint nb_trace;
guint iter_trace, iter_tracefile;
nb_trace = pos->nb_trace;
guint iter_trace, iter_tracefile;
nb_trace = pos->nb_trace;
@@
-1013,11
+1000,9
@@
gint lttv_traceset_context_ctx_pos_compare(const LttvTracesetContext *self,
for(iter_tracefile = 0; iter_tracefile < nb_tracefile; iter_tracefile++) {
tfc = tc->tracefiles[iter_tracefile];
event = tfc->e;
for(iter_tracefile = 0; iter_tracefile < nb_tracefile; iter_tracefile++) {
tfc = tc->tracefiles[iter_tracefile];
event = tfc->e;
- if(
- ret =
- ltt_event_event_position_compare(event,
- pos->t_pos[iter_trace].tf_pos[iter_tracefile])
- != 0)
+ ret = ltt_event_event_position_compare(event,
+ pos->t_pos[iter_trace].tf_pos[iter_tracefile]);
+ if(ret != 0)
return ret;
}
}
return ret;
}
}
@@
-1045,11
+1030,10
@@
gint lttv_traceset_context_pos_pos_compare(
g_error("lttv_traceset_context_ctx_pos_compare : nb_tracefile does not match.");
for(iter_tracefile = 0; iter_tracefile < nb_tracefile; iter_tracefile++) {
g_error("lttv_traceset_context_ctx_pos_compare : nb_tracefile does not match.");
for(iter_tracefile = 0; iter_tracefile < nb_tracefile; iter_tracefile++) {
- if(ret =
- ltt_event_position_compare(
+ ret = ltt_event_position_compare(
pos1->t_pos[iter_trace].tf_pos[iter_tracefile],
pos1->t_pos[iter_trace].tf_pos[iter_tracefile],
- pos2->t_pos[iter_trace].tf_pos[iter_tracefile])
- != 0)
+ pos2->t_pos[iter_trace].tf_pos[iter_tracefile])
;
+ if(ret != 0)
return ret;
}
}
return ret;
}
}
This page took
0.032573 seconds
and
4
git commands to generate.