aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/trace.c
diff options
context:
space:
mode:
authorChristopher Kenna <cjk@cs.unc.edu>2011-01-07 20:46:25 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-01-12 19:29:35 -0500
commit37eb46be881dde4b405d3d8b48e76b4a8d62ae2c (patch)
treeaab617d44f19114ecc9ea7cf7e1d64ee35430005 /litmus/trace.c
parent7648363e5636bd865aeac3236eb4675f0687eb4a (diff)
Feather-Trace: register devices with sysfs
This patch implements support for Feather-Trace devices to use the sysfs file system and, consequently, udev support. This allows us to allocate major/minor numbers for Feather-Trace devices dynamically, which is desirable because our old static allocations tend to create conflicts on modern distributions and/or when there are many cores.
Diffstat (limited to 'litmus/trace.c')
-rw-r--r--litmus/trace.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/litmus/trace.c b/litmus/trace.c
index b3a6b47aad6e..da650dfe7f4d 100644
--- a/litmus/trace.c
+++ b/litmus/trace.c
@@ -71,9 +71,6 @@ feather_callback void save_timestamp_cpu(unsigned long event,
71 */ 71 */
72#define NO_TIMESTAMPS (2 << 11) 72#define NO_TIMESTAMPS (2 << 11)
73 73
74/* set MAJOR to 0 to have it dynamically assigned */
75#define FT_TRACE_MAJOR 252
76
77static int alloc_timestamp_buffer(struct ftdev* ftdev, unsigned int idx) 74static int alloc_timestamp_buffer(struct ftdev* ftdev, unsigned int idx)
78{ 75{
79 unsigned int count = NO_TIMESTAMPS; 76 unsigned int count = NO_TIMESTAMPS;
@@ -94,11 +91,11 @@ static void free_timestamp_buffer(struct ftdev* ftdev, unsigned int idx)
94static int __init init_ft_overhead_trace(void) 91static int __init init_ft_overhead_trace(void)
95{ 92{
96 printk("Initializing Feather-Trace overhead tracing device.\n"); 93 printk("Initializing Feather-Trace overhead tracing device.\n");
97 ftdev_init(&overhead_dev, THIS_MODULE); 94 ftdev_init(&overhead_dev, THIS_MODULE, "ft_trace");
98 overhead_dev.minor_cnt = 1; /* only one buffer */ 95 overhead_dev.minor_cnt = 1; /* only one buffer */
99 overhead_dev.alloc = alloc_timestamp_buffer; 96 overhead_dev.alloc = alloc_timestamp_buffer;
100 overhead_dev.free = free_timestamp_buffer; 97 overhead_dev.free = free_timestamp_buffer;
101 return register_ftdev(&overhead_dev, "ft_trace", FT_TRACE_MAJOR); 98 return register_ftdev(&overhead_dev);
102} 99}
103 100
104module_init(init_ft_overhead_trace); 101module_init(init_ft_overhead_trace);