convert from svn repository: remove tags directory
[lttv.git] / trunk / tests / markers / test-micro-loop-empty.c
CommitLineData
bc82195a 1/* test-micro-loop-marker.c
2 *
3 * Execute a marker in a loop
4 */
5
6#include <linux/marker.h>
7#include <linux/module.h>
8#include <linux/proc_fs.h>
9#include <linux/sched.h>
10#include <asm/ptrace.h>
11#include <linux/timex.h>
12
13#define NR_LOOPS 10000000
14
15struct proc_dir_entry *pentry = NULL;
16
17static int my_open(struct inode *inode, struct file *file)
18{
19 unsigned int i;
20 unsigned long flags;
21 cycles_t time1, time2;
22
23 local_irq_save(flags);
24 time1 = get_cycles();
25 for(i=0; i<NR_LOOPS; i++) {
26 // MARK(subsys_mark1, "%d %p", 1, NULL);
27 }
28 time2 = get_cycles();
29 local_irq_restore(flags);
30 printk("time delta (cycles): %llu\n", time2-time1);
31
32 return -EPERM;
33}
34
35
36static struct file_operations my_operations = {
37 .open = my_open,
38};
39
40int init_module(void)
41{
42 pentry = create_proc_entry("testmark", 0444, NULL);
43 if (pentry)
44 pentry->proc_fops = &my_operations;
45
46 return 0;
47}
48
49void cleanup_module(void)
50{
51 remove_proc_entry("testmark", NULL);
52}
53
54MODULE_LICENSE("GPL");
55MODULE_AUTHOR("Mathieu Desnoyers");
56MODULE_DESCRIPTION("Marker Test");
57
This page took 0.03216 seconds and 4 git commands to generate.