From 37eb46be881dde4b405d3d8b48e76b4a8d62ae2c Mon Sep 17 00:00:00 2001 From: Christopher Kenna Date: Fri, 7 Jan 2011 20:46:25 -0500 Subject: 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. --- litmus/trace.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'litmus/trace.c') 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, */ #define NO_TIMESTAMPS (2 << 11) -/* set MAJOR to 0 to have it dynamically assigned */ -#define FT_TRACE_MAJOR 252 - static int alloc_timestamp_buffer(struct ftdev* ftdev, unsigned int idx) { unsigned int count = NO_TIMESTAMPS; @@ -94,11 +91,11 @@ static void free_timestamp_buffer(struct ftdev* ftdev, unsigned int idx) static int __init init_ft_overhead_trace(void) { printk("Initializing Feather-Trace overhead tracing device.\n"); - ftdev_init(&overhead_dev, THIS_MODULE); + ftdev_init(&overhead_dev, THIS_MODULE, "ft_trace"); overhead_dev.minor_cnt = 1; /* only one buffer */ overhead_dev.alloc = alloc_timestamp_buffer; overhead_dev.free = free_timestamp_buffer; - return register_ftdev(&overhead_dev, "ft_trace", FT_TRACE_MAJOR); + return register_ftdev(&overhead_dev); } module_init(init_ft_overhead_trace); -- cgit v1.2.2