From d1a840d7194fdd09c1bd9977e30fd391ef2a7526 Mon Sep 17 00:00:00 2001 From: Andrea Bastoni Date: Tue, 19 Jan 2010 19:38:14 -0500 Subject: [ported from 2008.3] Add Feather-Trace x86_32 architecture dependent code - [ported from 2008.3] Add x86_32 architecture dependent code. - Add the infrastructure for x86_32 - x86_64 integration. --- include/litmus/feather_trace.h | 25 ++++++++++++------------- include/litmus/sched_trace.h | 4 ++-- include/litmus/trace.h | 4 ++-- 3 files changed, 16 insertions(+), 17 deletions(-) (limited to 'include/litmus') diff --git a/include/litmus/feather_trace.h b/include/litmus/feather_trace.h index eef8af7a414e..7d27e763406f 100644 --- a/include/litmus/feather_trace.h +++ b/include/litmus/feather_trace.h @@ -1,6 +1,7 @@ #ifndef _FEATHER_TRACE_H_ #define _FEATHER_TRACE_H_ +#include #include int ft_enable_event(unsigned long id); @@ -8,6 +9,17 @@ int ft_disable_event(unsigned long id); int ft_is_event_enabled(unsigned long id); int ft_disable_all_events(void); +/* atomic_* funcitons are inline anyway */ +static inline int fetch_and_inc(int *val) +{ + return atomic_add_return(1, (atomic_t*) val) - 1; +} + +static inline int fetch_and_dec(int *val) +{ + return atomic_sub_return(1, (atomic_t*) val) + 1; +} + #ifndef __ARCH_HAS_FEATHER_TRACE /* provide default implementation */ @@ -32,19 +44,6 @@ extern int ft_events[MAX_EVENTS]; #define ft_event3(id, callback, p, p2, p3) \ if (ft_events[id]) callback(id, p, p2, p3); -#include - -static inline int fetch_and_inc(int *val) -{ - return atomic_add_return(1, (atomic_t*) val) - 1; -} - -static inline int fetch_and_dec(int *val) -{ - return atomic_sub_return(1, (atomic_t*) val) + 1; -} - #endif - #endif diff --git a/include/litmus/sched_trace.h b/include/litmus/sched_trace.h index aae6ac27fe1b..e1b0c9712b5f 100644 --- a/include/litmus/sched_trace.h +++ b/include/litmus/sched_trace.h @@ -167,12 +167,12 @@ feather_callback void do_sched_trace_sys_release(unsigned long id, SCHED_TRACE(SCHED_TRACE_BASE_ID + 5, do_sched_trace_task_switch_away, t) #define sched_trace_task_completion(t, forced) \ SCHED_TRACE2(SCHED_TRACE_BASE_ID + 6, do_sched_trace_task_completion, t, \ - forced) + (unsigned long) forced) #define sched_trace_task_block(t) \ SCHED_TRACE(SCHED_TRACE_BASE_ID + 7, do_sched_trace_task_block, t) #define sched_trace_task_resume(t) \ SCHED_TRACE(SCHED_TRACE_BASE_ID + 8, do_sched_trace_task_resume, t) - +/* when is a pointer, it does not need an explicit cast to unsigned long */ #define sched_trace_sys_release(when) \ SCHED_TRACE(SCHED_TRACE_BASE_ID + 9, do_sched_trace_sys_release, when) diff --git a/include/litmus/trace.h b/include/litmus/trace.h index e8e0c7b6cc6a..b32c71180774 100644 --- a/include/litmus/trace.h +++ b/include/litmus/trace.h @@ -32,13 +32,13 @@ feather_callback void save_timestamp_cpu(unsigned long event, unsigned long cpu) #define TIMESTAMP(id) ft_event0(id, save_timestamp) -#define DTIMESTAMP(id, def) ft_event1(id, save_timestamp_def, def) +#define DTIMESTAMP(id, def) ft_event1(id, save_timestamp_def, (unsigned long) def) #define TTIMESTAMP(id, task) \ ft_event1(id, save_timestamp_task, (unsigned long) task) #define CTIMESTAMP(id, cpu) \ - ft_event1(id, save_timestamp_cpu, cpu) + ft_event1(id, save_timestamp_cpu, (unsigned long) cpu) #else /* !CONFIG_SCHED_OVERHEAD_TRACE */ -- cgit v1.2.2