From 48b002b83347c16855548a1f214c76343d53cbf6 Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 1 Mar 2006 23:14:53 +0000 Subject: [PATCH] fix process end of life git-svn-id: http://ltt.polymtl.ca/svn@1569 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/ChangeLog | 2 ++ ltt/branches/poly/configure.in | 2 +- ltt/branches/poly/lttv/lttv/state.c | 13 ++++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ltt/branches/poly/ChangeLog b/ltt/branches/poly/ChangeLog index 7248fb69..cb342b11 100644 --- a/ltt/branches/poly/ChangeLog +++ b/ltt/branches/poly/ChangeLog @@ -1,5 +1,7 @@ LinuxTraceToolkit ChangeLog +01/03/2006 LTTV 0.8.25 + Fix process end of life in state.c 28/02/2006 LTTV 0.8.24 Fix heartbeat support 27/02/2006 LTTV 0.8.23 diff --git a/ltt/branches/poly/configure.in b/ltt/branches/poly/configure.in index ba224632..2285bf68 100644 --- a/ltt/branches/poly/configure.in +++ b/ltt/branches/poly/configure.in @@ -23,7 +23,7 @@ AC_PREREQ(2.57) AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) #AC_WITH_LTDL # not needed ? -AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.24-28022006) +AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.25-01032006) AM_CONFIG_HEADER(config.h) AM_PROG_LIBTOOL diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index eba65ab8..6c7fb339 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -1252,6 +1252,7 @@ static gboolean schedchange(void *hook_data, void *call_data) guint cpu = ltt_tracefile_num(s->parent.tf); LttvTraceState *ts = (LttvTraceState*)s->parent.t_context; LttvProcessState *process = ts->running_process[cpu]; + LttvProcessState *old_process = ts->running_process[cpu]; LttEvent *e = ltt_tracefile_get_event(s->parent.tf); LttvTraceHookByFacility *thf = (LttvTraceHookByFacility *)hook_data; @@ -1271,7 +1272,8 @@ static gboolean schedchange(void *hook_data, void *call_data) the wrongly attributed statistics. */ //This test only makes sense once the state is known and if there is no - //missing events. + //missing events. We need to silently ignore schedchange coming after a + //process_free, or it causes glitches. (FIXME) //if(unlikely(process->pid != pid_out)) { // g_assert(process->pid == 0); //} @@ -1284,8 +1286,8 @@ static gboolean schedchange(void *hook_data, void *call_data) else process->state->s = LTTV_STATE_WAIT; process->state->change = s->parent.timestamp; } - - if(state_out == 32) + + if(state_out == 32) exit_process(s, process); /* EXIT_DEAD */ /* see sched.h for states */ } @@ -1448,8 +1450,9 @@ static gboolean process_free(void *hook_data, void *call_data) break; } } - if(i == num_cpus) /* process is not scheduled */ - exit_process(s, process); + //if(i == num_cpus) /* process is not scheduled */ + //exit_process(s, process); // do nothing : wait for the schedchange to + //delete the process. } return FALSE; -- 2.34.1