Mostly set but unused variable.
One discard const qualifier
Most of the time, the offending code was removed. In some
places, it was commented out with a TODO because a full
remove will necessitate too much code rework for now.
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-
+
#include <glib.h>
#include <lttv/lttv.h>
#include <lttv/module.h>
{
guint i, nb_tracefile, nb_cpus, nb_irqs, nb_soft_irqs;
- LttvTracefileState *tfcs;
-
LttvAttribute *tracefiles_tree, *tracefile_tree;
guint *running_process;
nb_tracefile = self->parent.tracefiles->len;
for(i = 0 ; i < nb_tracefile ; i++) {
- tfcs =
- LTTV_TRACEFILE_STATE(g_array_index(self->parent.tracefiles,
- LttvTracefileContext*, i));
+
type = lttv_attribute_get(tracefiles_tree, i, &name, &value, &is_named);
g_assert(type == LTTV_GOBJECT);
tracefile_tree = *((LttvAttribute **)(value.v_gobject));
//guint8 ev_id = ltt_event_eventtype_id(e);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
struct marker_field *f = lttv_trace_get_hook_field(th, 0);
- LttvNameTables *nt = ((LttvTraceState *)(s->parent.t_context))->name_tables;
- LttvExecutionSubmode submode;
+
guint64 softirq = ltt_event_get_long_unsigned(e, f);
expand_soft_irq_table(ts, softirq);
- submode = nt->soft_irq_names[softirq];
-
/* update softirq status */
/* a soft irq raises are not cumulative */
ts->soft_irq_states[softirq].pending=1;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
guint id;
- guint64 address;
char *symbol;
id = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0));
- address = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
symbol = ltt_event_get_string(e, lttv_trace_get_hook_field(th, 2));
expand_syscall_table(ts, id);
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
guint id;
- guint64 address;
char *symbol;
id = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0));
- address = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
symbol = ltt_event_get_string(e, lttv_trace_get_hook_field(th, 2));
expand_soft_irq_table(ts, id);
LttvTracefileState *s = (LttvTracefileState *)call_data;
LttEvent *e = ltt_tracefile_get_event(s->parent.tf);
LttvTraceHook *th = (LttvTraceHook *)hook_data;
- guint parent_pid;
guint child_pid; /* In the Linux Kernel, there is one PID per thread. */
guint child_tgid; /* tgid in the Linux kernel is the "real" POSIX PID. */
//LttvProcessState *zombie_process;
LttvProcessState *child_process;
struct marker_field *f;
- /* Parent PID */
- parent_pid = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0));
+ /* Skip Parent PID param */
/* Child PID */
child_pid = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 1));
LttvProcessState *process = ts->running_process[cpu];
LttvProcessState *parent_process;
struct marker_field *f;
- GQuark type, mode, submode, status;
+ GQuark type;
LttvExecutionState *es;
guint i, nb_cpus;
//FIXME: type is rarely used, enum must match possible types.
- /* mode */
- f = lttv_trace_get_hook_field(th, 4);
- mode = ltt_enum_string_get(f,ltt_event_get_unsigned(e, f));
+ /* Skip mode 4th param */
- /* submode */
- f = lttv_trace_get_hook_field(th, 5);
- submode = ltt_enum_string_get(f, ltt_event_get_unsigned(e, f));
+ /* Skip submode 5th param */
- /* status */
- f = lttv_trace_get_hook_field(th, 6);
- status = ltt_enum_string_get(f, ltt_event_get_unsigned(e, f));
+ /* Skip status 6th param */
/* TGID */
f = lttv_trace_get_hook_field(th, 7);
{
LttvTracefileStats *tfcs = (LttvTracefileStats *)call_data;
- LttEvent *e = ltt_tracefile_get_event(tfcs->parent.parent.tf);
-
- LttvTraceHook *th = (LttvTraceHook *)hook_data;
-
- guint pid_in, pid_out;
-
- gint64 state_out;
-
- pid_out = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0));
- pid_in = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 1));
- state_out = ltt_event_get_long_int(e, lttv_trace_get_hook_field(th, 2));
-
/* compute the time for the process to schedule out */
mode_change(tfcs);
LttvTraceState *ts = (LttvTraceState*)tfcs->parent.parent.t_context;
- LttEvent *e = ltt_tracefile_get_event(tfcs->parent.parent.tf);
-
- LttvTraceHook *th = (LttvTraceHook *)hook_data;
-
- guint pid_in, pid_out;
-
- gint64 state_out;
-
LttvProcessState *process;
- pid_out = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0));
- pid_in = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 1));
- state_out = ltt_event_get_long_int(e, lttv_trace_get_hook_field(th, 2));
-
/* get the information for the process scheduled in */
guint cpu = tfcs->parent.cpu;
process = ts->running_process[cpu];
{
LttvAttribute *sum_container = self->stats;
- LttvAttributeType type;
-
LttvAttributeValue value;
LttvAttributeName name;
nb_process = lttv_attribute_get_number(processes_tree);
for(i = 0 ; i < nb_process ; i++) {
- type = lttv_attribute_get(processes_tree, i, &name, &value, &is_named);
+ lttv_attribute_get(processes_tree, i, &name, &value, &is_named);
process_tree = LTTV_ATTRIBUTE(*(value.v_gobject));
cpus_tree = lttv_attribute_find_subdir(process_tree, LTTV_STATS_CPU);
nb_cpu = lttv_attribute_get_number(cpus_tree);
for(j = 0 ; j < nb_cpu ; j++) {
- type = lttv_attribute_get(cpus_tree, j, &name, &value, &is_named);
+ lttv_attribute_get(cpus_tree, j, &name, &value, &is_named);
cpu_tree = LTTV_ATTRIBUTE(*(value.v_gobject));
trace_cpu_tree = lttv_attribute_find_subdir(main_tree,
nb_functions = lttv_attribute_get_number(cpu_functions_tree);
for(nf=0; nf < nb_functions; nf++) {
- type = lttv_attribute_get(cpu_functions_tree, nf, &name, &value,
+ lttv_attribute_get(cpu_functions_tree, nf, &name, &value,
&is_named);
function_tree = LTTV_ATTRIBUTE(*(value.v_gobject));
function_mode_types_tree = lttv_attribute_find_subdir(function_tree,
LTTV_STATS_MODE_TYPES);
nb_mode_type = lttv_attribute_get_number(function_mode_types_tree);
for(k = 0 ; k < nb_mode_type ; k++) {
- type = lttv_attribute_get(function_mode_types_tree, k, &name,
+ lttv_attribute_get(function_mode_types_tree, k, &name,
&value, &is_named);
mode_tree = LTTV_ATTRIBUTE(*(value.v_gobject));
nb_submode = lttv_attribute_get_number(submodes_tree);
for(l = 0 ; l < nb_submode ; l++) {
- type = lttv_attribute_get(submodes_tree, l, &name, &value,
+ lttv_attribute_get(submodes_tree, l, &name, &value,
&is_named);
submode_tree = LTTV_ATTRIBUTE(*(value.v_gobject));
sum = 0;
for(m = 0 ; m < nb_event_type ; m++) {
- type = lttv_attribute_get(event_types_tree, m, &name,
+ lttv_attribute_get(event_types_tree, m, &name,
&value, &is_named);
sum += *(value.v_uint);
}
LTTV_UINT, &value);
*(value.v_uint) = sum;
- type = lttv_attribute_get(submodes_tree, l, &name, &value,
+ lttv_attribute_get(submodes_tree, l, &name, &value,
&is_named);
submode_tree = LTTV_ATTRIBUTE(*(value.v_gobject));
if(!trace_is_summed) {
static void analyzeExchangeLinReg(SyncState* const syncState, Exchange* const exchange)
{
unsigned int ni, nj;
- double dji, eji;
+ double dji;
double timoy;
Fit* fit;
Message* ackedMessage;
dji= ((double) ackedMessage->inE->cpuTime - (double) ackedMessage->outE->cpuTime
+ (double) exchange->message->outE->cpuTime - (double)
exchange->message->inE->cpuTime) / 2;
- eji= fabs((double) ackedMessage->inE->cpuTime - (double)
- ackedMessage->outE->cpuTime - (double) exchange->message->outE->cpuTime +
- (double) exchange->message->inE->cpuTime) / 2;
timoy= ((double) ackedMessage->outE->cpuTime + (double)
exchange->message->inE->cpuTime) / 2;
ni= ackedMessage->outE->traceNum;
*/
static AllFactors* finalizeProcessingLTTVStandard(SyncState* const syncState)
{
- ProcessingDataLTTVStandard* processingData;
-
- processingData= (ProcessingDataLTTVStandard*) syncState->processingData;
-
partialDestroyProcessingLTTVStandard(syncState);
return syncState->matchingModule->finalizeMatching(syncState);
GArray* factors;
double minOffset, minDrift;
unsigned int refFreqTrace;
- int retval;
if (!optionSync.present)
{
if (optionSyncStats.present)
{
gettimeofday(&endTime, 0);
- retval= getrusage(RUSAGE_SELF, &endUsage);
+ getrusage(RUSAGE_SELF, &endUsage);
timeDiff(&endTime, &startTime);
timeDiff(&endUsage.ru_utime, &startUsage.ru_utime);
void drawing_update_ruler(Drawing_t *drawing, TimeWindow *time_window)
{
- GtkRequisition req;
- GdkRectangle rect;
-
- req.width = drawing->ruler->allocation.width;
- req.height = drawing->ruler->allocation.height;
-
-
- rect.x = 0;
- rect.y = 0;
- rect.width = req.width;
- rect.height = req.height;
-
gtk_widget_queue_draw(drawing->ruler);
- //gtk_widget_draw( drawing->ruler, &rect);
}
/* Redraw the ruler */
guint pid_out;
guint pid_in;
- guint state_out;
{
pid_out = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));
pid_in = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
- state_out = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 2));
}
tfc->target_pid = pid_out;
guint pid_in;
{
- guint pid_out;
- pid_out = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));
pid_in = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
}
/* Get the beginning position of the read (with seek backward or seek forward)
*/
if(relative_position > 0) {
- guint count;
- count = lttv_process_traceset_seek_n_forward(tsc, relative_position,
+
+ lttv_process_traceset_seek_n_forward(tsc, relative_position,
events_check_handler,
&event_viewer_data->tab->stop_foreground,
event_viewer_data->main_win_filter,
event_viewer_data->filter, NULL, event_viewer_data);
} else if(relative_position < 0) {
- guint count;
-
+
/* Get an idea of currently shown event dispersion */
LttTime first_event_time =
lttv_traceset_context_position_get_time(event_viewer_data->first_event);
if(ltt_time_compare(time_diff, ltt_time_zero) == 0)
time_diff = seek_back_default_offset;
- count = lttv_process_traceset_seek_n_backward(tsc,
+ lttv_process_traceset_seek_n_backward(tsc,
abs(relative_position),
time_diff,
(seek_time_fct)lttv_state_traceset_seek_time_closest,
guihistocontrolflow(LttvPluginTab *ptab)
{
GtkWidget *button_widget, *drawing_widget, *drawing_area;
- GtkWidget *buttonP,*buttonM;
histoDrawing_t *drawing;
HistoControlFlowData* histo_control_flow_data = g_new(HistoControlFlowData,1) ;
histo_control_flow_data->buttonwidget = histo_buttonwidget_construct(histo_control_flow_data);
button_widget = histo_buttonwidget_get_widget( histo_control_flow_data-> buttonwidget);
- buttonP =histo_control_flow_data-> buttonwidget->buttonP;
- buttonM =histo_control_flow_data-> buttonwidget->buttonM;
//set the size of ruler fix
gtk_widget_set_size_request(histo_control_flow_data->drawing->ruler, -1, 25);
void histo_drawing_update_ruler(histoDrawing_t *drawing, TimeWindow *time_window)
{
- GtkRequisition req;
- GdkRectangle rect;
-
- req.width = drawing->ruler->allocation.width;
- req.height = drawing->ruler->allocation.height;
-
-
- rect.x = 0;
- rect.y = 0;
- rect.width = req.width;
- rect.height = req.height;
-
gtk_widget_queue_draw(drawing->ruler);
- //gtk_widget_draw( drawing->ruler, &rect);
}
/* Redraw the ruler */
void histo_drawing_update_vertical_ruler(histoDrawing_t *drawing)//, TimeWindow *time_window)
{
- GtkRequisition req;
- GdkRectangle rect;
-
- req.width = drawing->vertical_ruler->allocation.width;
- req.height = drawing->vertical_ruler->allocation.height;
-
- rect.x = 0;
- rect.y = 0;
- rect.width = req.width;
- rect.height = req.height;
-
gtk_widget_queue_draw(drawing->vertical_ruler);
- //gtk_widget_draw( drawing->ruler, &rect);
}
/* notify mouse on ruler */
TimeWindow time_window = lttvwindow_get_time_window( tab );
LttTime time_start, time_end;
- LttvTraceState *ts;
-
//find the tracehooks
LttvTracesetContext *tsc = lttvwindow_get_traceset_context(tab);
histo_after_chunk,
histo_events_request,
LTTV_PRIO_DEFAULT);
- ts = (LttvTraceState *)tsc->traces[i];
// Fill the events request
histo_events_request->owner = histocontrol_flow_data;
histo_events_request->viewer_data = histocontrol_flow_data;
return 0;
}
-
+/* TODO ybrosseau 2012-03-15: Cleanup line_src */
void histogram_show(HistoControlFlowData *histocontrol_flow_data,guint draw_begin,
guint draw_end)
{
guint val, h_val;
- guint i, line_src;
+ guint i/*, line_src*/;
guint end_chunk=MIN(draw_end,(histocontrol_flow_data->number_of_process)->len);
for (i=draw_begin/*0*/;i<end_chunk/* (histocontrol_flow_data->number_of_process)->len*/;i++){
histo_convert_pixels_to_time(width, i+1,
time_window,
&t2);
- line_src=i;
+ /* line_src=i; */
//check if zoom in is used and more than 1 pixel correspond to each 1nsec
//used for drawing point (not line) on the screen.
g_object_set_data(G_OBJECT(tab->viewer_container), "focused_viewer", NULL);
}
-
+#if UNFINISHED_FEATURE
+/* TODO ybrosseau 2012-03-15: Function is half implemented. Should be removed */
/* open_traceset will open a traceset saved in a file
* Right now, it is not finished yet, (not working)
* FIXME
}
}
-
+#endif
/* lttvwindow_process_pending_requests
*
* Process requests for parts of the trace from viewers.
tfc = lttv_traceset_context_get_current_tfc(tsc);
g_assert(g_slist_length(list_in)>0);
EventsRequest *events_request = g_slist_nth_data(list_in, 0);
+#ifdef DEBUG
guint seek_count;
+#endif
/* 1.2.1 If first request in list_in is a time request */
if(events_request->start_position == NULL) {
events_request->start_time);
/* Process the traceset with only state hooks */
+#ifdef DEBUG
seek_count =
+#endif //DEBUG
lttv_process_traceset_middle(tsc,
events_request->start_time,
G_MAXUINT, NULL);
pos_time);
/* Process the traceset with only state hooks */
+#ifdef DEBUG
seek_count =
+#endif
lttv_process_traceset_middle(tsc,
ltt_time_infinite,
G_MAXUINT,
on_open_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
+#ifdef UNFINISHED_FEATURE
open_traceset((GtkWidget*)menuitem, user_data);
+#endif
}
on_button_open_clicked (GtkButton *button,
gpointer user_data)
{
+#ifdef UNFINISHED_FEATURE
open_traceset((GtkWidget*)button, user_data);
+#endif
}
LttvIAttribute *attributes =
LTTV_IATTRIBUTE(g_object_new(LTTV_ATTRIBUTE_TYPE, NULL));
LttvAttributeValue value;
- Tab *new_tab;
-
+
new_m_window = g_new(MainWindow, 1);
// Add the object's information to the module's array
"Tab_Plugin",
ptab,
(GDestroyNotify)tab_destructor);
- new_tab = ptab->tab;
} else {
LttvPluginTab *ptab = g_object_new(LTTV_TYPE_PLUGIN_TAB, NULL);
init_tab(ptab->tab, new_m_window, NULL, notebook, "Traceset");
"Tab_Plugin",
ptab,
(GDestroyNotify)tab_destructor);
- new_tab = ptab->tab;
}
/* Insert default viewers */
LttvTrace *trace)
{
LttvAttribute *attribute = lttv_trace_attribute(trace);
- LttvAttributeValue value;
attribute =
LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(attribute),
module_name));
g_assert(attribute);
- value = lttv_iattribute_add(LTTV_IATTRIBUTE(attribute),
- LTTV_IN_PROGRESS,
- LTTV_INT);
+ lttv_iattribute_add(LTTV_IATTRIBUTE(attribute),
+ LTTV_IN_PROGRESS,
+ LTTV_INT);
/* the value is left unset. The only presence of the attribute is necessary.
*/
}
LttvTrace *trace)
{
LttvAttribute *attribute = lttv_trace_attribute(trace);
- LttvAttributeValue value;
attribute =
LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(attribute),
module_name));
g_assert(attribute);
- value = lttv_iattribute_add(LTTV_IATTRIBUTE(attribute),
- LTTV_READY,
- LTTV_INT);
+ lttv_iattribute_add(LTTV_IATTRIBUTE(attribute),
+ LTTV_READY,
+ LTTV_INT);
/* the value is left unset. The only presence of the attribute is necessary.
*/
}
void drawing_update_ruler(Drawing_t *drawing, TimeWindow *time_window)
{
- GtkRequisition req;
- GdkRectangle rect;
-
- req.width = drawing->ruler->allocation.width;
- req.height = drawing->ruler->allocation.height;
-
-
- rect.x = 0;
- rect.y = 0;
- rect.width = req.width;
- rect.height = req.height;
-
gtk_widget_queue_draw(drawing->ruler);
- //gtk_widget_draw( drawing->ruler, &rect);
}
/* Redraw the ruler */
*/
guint pid_out;
- guint pid_in;
pid_out = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));
- pid_in = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
// TODO: can't we reenable this? pmf
// if(pid_in != 0 && pid_out != 0) {
// /* not a transition to/from idle */
/* Add process to process list (if not present) */
LttvProcessState *process_in;
- LttTime birth;
HashedResourceData *hashed_process_data_in = NULL;
ProcessList *process_list = resourceview_data->process_list;
- guint pid_in;
- {
- guint pid_out;
- pid_out = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));
- pid_in = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
- }
-
-
/* Find process pid_in in the list... */
//process_in = lttv_state_find_process(ts, ANY_CPU, pid_in);
//process_in = tfs->process;
#ifdef EXTRA_CHECK
g_assert(process_in != NULL);
#endif //EXTRA_CHECK
- birth = process_in->creation_time;
//hashed_process_data_in = processlist_get_process_data(process_list, cpuq, trace_num);
hashed_process_data_in = resourcelist_obtain_cpu(resourceview_data, trace_num, cpu);
/* Determine if we should add it hidden or not */
{
- gboolean result;
GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(resourceview_data->process_list->process_list_widget));
GtkTreeIter parent_iter;
- result = gtk_tree_model_iter_parent(model, &parent_iter, &data->y_iter);
+ gtk_tree_model_iter_parent(model, &parent_iter, &data->y_iter);
GtkTreePath *path = gtk_tree_model_get_path(model, &parent_iter);
data->hidden = gtk_tree_view_row_expanded(GTK_TREE_VIEW(resourceview_data->process_list->process_list_widget), path)?0:1;
gtk_tree_path_free(path);
value = lttv_attribute_add(tscs->stats,
g_quark_from_static_string("WARNING: Live traceset"),
LTTV_STRING);
- *(value.v_string) = live_msg;
+ /* TODO ybrosseau 2012-03-15: add cast to silent discard const
+ warning... find a better way */
+ *(value.v_string) = (char *)live_msg;
}
g_hash_table_insert(statistic_viewer_data->statistic_hash,
int status;
ssize_t count;
/* discuss with su */
- struct timeval timeout;
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
struct pollfd pollfd;
int num_rdy;
LttvTracefileState *tfs = (LttvTracefileState *)call_data;
- LttEvent *e;
-
/* Only save at LTTV_STATE_SAVE_INTERVAL */
if(likely((*event_count)++ < LTTV_STATE_SAVE_INTERVAL))
return FALSE;
LttvTraceState *ts = (LttvTraceState*)tfc->t_context;
- e = ltt_tracefile_get_event(tfc->tf);
-
if(a_raw) {
lttv_state_write_raw(ts, tfs->parent.timestamp, a_file);
} else {
SyncState* syncState;
struct timeval endTime;
struct rusage endUsage;
- int retval;
tracesetChainState= g_hash_table_lookup(tracesetChainStates, traceSetContext);
syncState= tracesetChainState->syncState;
free(syncState);
gettimeofday(&endTime, 0);
- retval= getrusage(RUSAGE_SELF, &endUsage);
+ getrusage(RUSAGE_SELF, &endUsage);
timeDiff(&endTime, &tracesetChainState->startTime);
timeDiff(&endUsage.ru_utime, &tracesetChainState->startUsage.ru_utime);