#endif //0
}
+static inline guint64 ltt_time_to_uint64(LttTime t1)
+{
+ return (guint64)t1.tv_sec*NANOSECONDS_PER_SECOND
+ + (guint64)t1.tv_nsec;
+}
+
+
+#define MAX_TV_SEC_TO_UINT64 0x3FFFFFFFFFFFFFFFULL
+static inline LttTime ltt_time_from_uint64(guint64 t1)
+{
+ /* We lose precision if tv_sec is > than (2^62)-1
+ * */
+ g_assert(t1 <= MAX_TV_SEC_TO_UINT64);
+ if(t1 > MAX_TV_SEC_TO_UINT64)
+ g_warning("Conversion from non precise uint64 to LttTime");
+ LttTime res;
+ res.tv_sec = t1/NANOSECONDS_PER_SECOND;
+ res.tv_nsec = (t1 - res.tv_sec*NANOSECONDS_PER_SECOND);
+ return res;
+}
#endif // LTT_TIME_H
return control_flow_data->top_widget ;
}
-ProcessList *guicontrolflow_get_process_list
+__inline ProcessList *guicontrolflow_get_process_list
(ControlFlowData *control_flow_data)
{
return control_flow_data->process_list ;
void
guicontrolflow_destructor(ControlFlowData *control_flow_data);
GtkWidget *guicontrolflow_get_widget(ControlFlowData *control_flow_data);
-ProcessList *guicontrolflow_get_process_list(ControlFlowData *control_flow_data);
+__inline ProcessList *guicontrolflow_get_process_list(ControlFlowData *control_flow_data);
#endif // _CFV_H
*
* Convert from window pixel and time interval to an absolute time.
*/
-//FIXME : could need ceil and floor versions of this function
-void convert_pixels_to_time(
+__inline void convert_pixels_to_time(
gint width,
guint x,
LttTime window_time_begin,
LttTime *time)
{
LttTime window_time_interval;
+ guint64 time_ll;
window_time_interval = ltt_time_sub(window_time_end,
window_time_begin);
- *time = ltt_time_mul(window_time_interval, (x/(float)width));
+ time_ll = ltt_time_to_uint64(window_time_interval);
+ time_ll = time_ll * x / width;
+ *time = ltt_time_from_uint64(time_ll);
*time = ltt_time_add(window_time_begin, *time);
}
-//FIXME : could need ceil and floor versions of this function
-void convert_time_to_pixels(
+__inline void convert_time_to_pixels(
LttTime window_time_begin,
LttTime window_time_end,
LttTime time,
guint *x)
{
LttTime window_time_interval;
- double interval_double, time_double;
+ guint64 time_ll, interval_ll;
g_assert(ltt_time_compare(window_time_begin, time) <= 0 &&
ltt_time_compare(window_time_end, time) >= 0);
time = ltt_time_sub(time, window_time_begin);
- /* LttTime to double conversions here should really be under 4000 hours.. */
- interval_double = ltt_time_to_double(window_time_interval);
- time_double = ltt_time_to_double(time);
+ time_ll = ltt_time_to_uint64(time);
+ interval_ll = ltt_time_to_uint64(window_time_interval);
- *x = (guint)(time_double/interval_double * width);
+ *x = (guint)(time_ll * width / interval_ll);
}
guint y,
guint height);
-void convert_pixels_to_time(
+__inline void convert_pixels_to_time(
gint width,
guint x,
LttTime window_time_begin,
LttTime window_time_end,
LttTime *time);
-void convert_time_to_pixels(
+__inline void convert_time_to_pixels(
LttTime window_time_begin,
LttTime window_time_end,
LttTime time,
#define MAX_PATH_LEN 256
/* drawing hook functions */
-gboolean draw_text( void *hook_data, void *call_data)
+__inline gboolean draw_text( void *hook_data, void *call_data)
{
PropertiesText *properties = (PropertiesText*)hook_data;
DrawContext *draw_context = (DrawContext*)call_data;
/* To speed up the process, search in already loaded icons list first. Only
* load it if not present.
*/
-gboolean draw_icon( void *hook_data, void *call_data)
+__inline gboolean draw_icon( void *hook_data, void *call_data)
{
PropertiesIcon *properties = (PropertiesIcon*)hook_data;
DrawContext *draw_context = (DrawContext*)call_data;
return 0;
}
-gboolean draw_line( void *hook_data, void *call_data)
+__inline gboolean draw_line( void *hook_data, void *call_data)
{
PropertiesLine *properties = (PropertiesLine*)hook_data;
DrawContext *draw_context = (DrawContext*)call_data;
return 0;
}
-gboolean draw_arc( void *hook_data, void *call_data)
+__inline gboolean draw_arc( void *hook_data, void *call_data)
{
PropertiesArc *properties = (PropertiesArc*)hook_data;
DrawContext *draw_context = (DrawContext*)call_data;
return 0;
}
-gboolean draw_bg( void *hook_data, void *call_data)
+__inline gboolean draw_bg( void *hook_data, void *call_data)
{
PropertiesBG *properties = (PropertiesBG*)hook_data;
DrawContext *draw_context = (DrawContext*)call_data;
* different items.
*/
-gboolean draw_text( void *hook_data, void *call_data);
-gboolean draw_icon( void *hook_data, void *call_data);
-gboolean draw_line( void *hook_data, void *call_data);
-gboolean draw_arc( void *hook_data, void *call_data);
-gboolean draw_bg( void *hook_data, void *call_data);
+__inline gboolean draw_text( void *hook_data, void *call_data);
+__inline gboolean draw_icon( void *hook_data, void *call_data);
+__inline gboolean draw_line( void *hook_data, void *call_data);
+__inline gboolean draw_arc( void *hook_data, void *call_data);
+__inline gboolean draw_bg( void *hook_data, void *call_data);
#endif // _DRAW_ITEM_H
LttTime time_begin = time_window.start_time;
LttTime width = time_window.time_width;
- LttTime half_width = ltt_time_div(width,2.0);
+ LttTime half_width;
+ {
+ guint64 time_ll = ltt_time_to_uint64(width);
+ time_ll = time_ll >> 1; /* divide by two */
+ half_width = ltt_time_from_uint64(time_ll);
+ }
LttTime time_end = ltt_time_add(time_begin, width);
LttvTracesetContext * tsc =
* Methods to synchronize process list *
*****************************************************************************/
-static guint get_cpu_number_from_name(GQuark name);
+static __inline guint get_cpu_number_from_name(GQuark name);
/* Enumeration of the columns */
enum
}
-gint processlist_get_process_pixels( ProcessList *process_list,
+__inline gint processlist_get_process_pixels( ProcessList *process_list,
guint pid, guint cpu, LttTime *birth, guint trace_num,
guint *y,
guint *height,
}
-gint processlist_get_pixels_from_data( ProcessList *process_list,
+__inline gint processlist_get_pixels_from_data( ProcessList *process_list,
ProcessInfo *process_info,
HashedProcessData *hashed_process_data,
guint *y,
}
-static guint get_cpu_number_from_name(GQuark name)
+static __inline guint get_cpu_number_from_name(GQuark name)
{
- /* remember / */
const gchar *string;
char *begin;
guint cpu;
guint processlist_get_height(ProcessList *process_list);
// Returns 0 on success
-gint processlist_get_process_pixels(ProcessList *process_list,
+__inline gint processlist_get_process_pixels(ProcessList *process_list,
guint pid, guint cpu, LttTime *birth, guint trace_num,
guint *y, guint *height,
HashedProcessData **hashed_process_data);
-gint processlist_get_pixels_from_data( ProcessList *process_list,
+__inline gint processlist_get_pixels_from_data( ProcessList *process_list,
ProcessInfo *process_info,
HashedProcessData *hashed_process_data,
guint *y,
* @return time window.
*/
-TimeWindow lttvwindow_get_time_window(Tab *tab)
+__inline TimeWindow lttvwindow_get_time_window(Tab *tab)
{
return tab->time_window;
* @return the current tab's time interval.
*/
-TimeWindow lttvwindow_get_time_window(Tab *tab);
+__inline TimeWindow lttvwindow_get_time_window(Tab *tab);
/**