oops.
#ifndef SLEEPOMETER_H
#define SLEEPOMETER_H
#include <linux/spinlock.h>
#include <asm/linkage.h>
struct sleepo_data {
spinlock_t lock;
unsigned long nr_sleeps;
unsigned long long total_usecs;
unsigned long long max_usecs;
const char *file;
const char *sleep_type;
int line;
struct sleepo_data *next;
};
void sleepo_io_schedule(void);
long sleepo_io_schedule_timeout(long timeout);
asmlinkage void sleepo_schedule(void);
void sleepo_preempt_schedule(void);
signed long sleepo_schedule_timeout(signed long timeout);
void sleepo_begin(const char *file, int line,
const char *sleep_type, struct sleepo_data *sd);
void sleepo_end(struct sleepo_data *sd);
void sleepo_start(const char *file, int line,
const char *sleep_type, struct sleepo_data *sd);
void sleepo_stop(struct sleepo_data *sd);
#define schedule() \
do { \
static struct sleepo_data sd; \
\
sleepo_start(__FILE__, __LINE__, "schedule", &sd); \
sleepo_schedule(); \
sleepo_stop(&sd); \
} while (0)
#define preempt_schedule() \
do { \
static struct sleepo_data sd; \
\
sleepo_start(__FILE__, __LINE__, "preempt_schedule" &sd);\
sleepo_preempt_schedule(); \
sleepo_stop(&sd); \
} while (0)
#define io_schedule() \
do { \
static struct sleepo_data sd; \
\
sleepo_start(__FILE__, __LINE__, "io_schedule", &sd); \
sleepo_io_schedule(); \
sleepo_stop(&sd); \
} while (0)
#define schedule_timeout(t) \
({ \
static struct sleepo_data sd; \
long ret; \
\
sleepo_start(__FILE__, __LINE__, "schedule_timeout", &sd);\
ret = sleepo_schedule_timeout(t); \
sleepo_stop(&sd); \
ret; \
})
#define io_schedule_timeout(t) \
({ \
static struct sleepo_data sd; \
long ret; \
\
sleepo_start(__FILE__, __LINE__, "io_schedule_timeout", &sd);\
ret = sleepo_io_schedule_timeout(t); \
sleepo_stop(&sd); \
ret; \
})
#endif /* SLEEPOMETER_H */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/