* [Patch] include blktrace_api.h in headers_install
@ 2008-07-16 11:24 Martin Peschke
2008-09-26 8:50 ` Jens Axboe
2008-09-26 19:34 ` Bastian Blank
0 siblings, 2 replies; 5+ messages in thread
From: Martin Peschke @ 2008-07-16 11:24 UTC (permalink / raw)
To: linux-s390, linux-btrace
From: Sven Schuetz <sven@linux.vnet.ibm.com>
This header file is of interest for user space programming, i.e.
for tools that process blktrace data.
We would like to use it for a tool on-top of blktrace which processes
data provided by blktrace. For this purpose, it would be helpful
if the blktrace API would make it to /usr/include/linux.
The git tree for the blktrace tools comes with its own copy of this header
file. I didn't manage to replace that copy with the file generated
by the patch below yet. A few more cleanups would be needed.
For example, the blktrace ioctl numbers, which are currently defined in
usr/include/fs.h, might need to be moved. Should be feasible, though.
Signed-off-by: Sven Schuetz <sven@linux.vnet.ibm.com>
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
---
include/linux/Kbuild | 1
include/linux/blktrace_api.h | 58 +++++++++++++++++++++++--------------------
2 files changed, 33 insertions(+), 26 deletions(-)
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -175,6 +175,7 @@ unifdef-y += audit.h
unifdef-y += auto_fs.h
unifdef-y += auxvec.h
unifdef-y += binfmts.h
+unifdef-y += blktrace_api.h
unifdef-y += capability.h
unifdef-y += capi.h
unifdef-y += cciss_ioctl.h
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -1,8 +1,10 @@
#ifndef BLKTRACE_H
#define BLKTRACE_H
+#ifdef __KERNEL__
#include <linux/blkdev.h>
#include <linux/relay.h>
+#endif
/*
* Trace categories
@@ -89,17 +91,17 @@ enum blktrace_notify {
* The trace itself
*/
struct blk_io_trace {
- u32 magic; /* MAGIC << 8 | version */
- u32 sequence; /* event number */
- u64 time; /* in microseconds */
- u64 sector; /* disk offset */
- u32 bytes; /* transfer length */
- u32 action; /* what happened */
- u32 pid; /* who did it */
- u32 device; /* device number */
- u32 cpu; /* on what cpu did it happen */
- u16 error; /* completion error */
- u16 pdu_len; /* length of data after this trace */
+ __u32 magic; /* MAGIC << 8 | version */
+ __u32 sequence; /* event number */
+ __u64 time; /* in microseconds */
+ __u64 sector; /* disk offset */
+ __u32 bytes; /* transfer length */
+ __u32 action; /* what happened */
+ __u32 pid; /* who did it */
+ __u32 device; /* device number */
+ __u32 cpu; /* on what cpu did it happen */
+ __u16 error; /* completion error */
+ __u16 pdu_len; /* length of data after this trace */
};
/*
@@ -117,6 +119,25 @@ enum {
Blktrace_stopped,
};
+/*
+ * User setup structure passed with BLKTRACESTART
+ */
+struct blk_user_trace_setup {
+#ifdef __KERNEL__
+ char name[BDEVNAME_SIZE]; /* output */
+#else
+ char name[32]; /* output */
+#endif
+ __u16 act_mask; /* input */
+ __u32 buf_size; /* input */
+ __u32 buf_nr; /* input */
+ __u64 start_lba;
+ __u64 end_lba;
+ __u32 pid;
+};
+
+#ifdef __KERNEL__
+#if defined(CONFIG_BLK_DEV_IO_TRACE)
struct blk_trace {
int trace_state;
struct rchan *rchan;
@@ -132,21 +153,6 @@ struct blk_trace {
atomic_t dropped;
};
-/*
- * User setup structure passed with BLKTRACESTART
- */
-struct blk_user_trace_setup {
- char name[BDEVNAME_SIZE]; /* output */
- u16 act_mask; /* input */
- u32 buf_size; /* input */
- u32 buf_nr; /* input */
- u64 start_lba;
- u64 end_lba;
- u32 pid;
-};
-
-#ifdef __KERNEL__
-#if defined(CONFIG_BLK_DEV_IO_TRACE)
extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *);
extern void blk_trace_shutdown(struct request_queue *);
extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *);
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Patch] include blktrace_api.h in headers_install
2008-07-16 11:24 [Patch] include blktrace_api.h in headers_install Martin Peschke
@ 2008-09-26 8:50 ` Jens Axboe
2008-09-26 19:34 ` Bastian Blank
1 sibling, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2008-09-26 8:50 UTC (permalink / raw)
To: linux-btrace
On Fri, Sep 26 2008, Jan Blunck wrote:
> On Wed, Jul 16, Martin Peschke wrote:
>
> > From: Sven Schuetz <sven@linux.vnet.ibm.com>
> >
> > This header file is of interest for user space programming, i.e.
> > for tools that process blktrace data.
> >
> > We would like to use it for a tool on-top of blktrace which processes
> > data provided by blktrace. For this purpose, it would be helpful
> > if the blktrace API would make it to /usr/include/linux.
> >
> > The git tree for the blktrace tools comes with its own copy of this header
> > file. I didn't manage to replace that copy with the file generated
> > by the patch below yet. A few more cleanups would be needed.
> > For example, the blktrace ioctl numbers, which are currently defined in
> > usr/include/fs.h, might need to be moved. Should be feasible, though.
> >
>
> Any reason why this patch isn't upstream yet?
Nope, I'll add it.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Patch] include blktrace_api.h in headers_install
2008-07-16 11:24 [Patch] include blktrace_api.h in headers_install Martin Peschke
2008-09-26 8:50 ` Jens Axboe
@ 2008-09-26 19:34 ` Bastian Blank
2008-09-29 15:30 ` Martin Peschke
1 sibling, 1 reply; 5+ messages in thread
From: Bastian Blank @ 2008-09-26 19:34 UTC (permalink / raw)
To: linux-btrace
On Wed, Jul 16, 2008 at 01:24:25PM +0200, Martin Peschke wrote:
> +#ifdef __KERNEL__
> + char name[BDEVNAME_SIZE]; /* output */
> +#else
> + char name[32]; /* output */
> +#endif
Bad idea. BDEVNAME_SIZE is not exported and therfor not part of the
public API. As this defines a userspace API it must not change anyway.
Bastian
--
No one can guarantee the actions of another.
-- Spock, "Day of the Dove", stardate unknown
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Patch] include blktrace_api.h in headers_install
2008-09-26 19:34 ` Bastian Blank
@ 2008-09-29 15:30 ` Martin Peschke
0 siblings, 0 replies; 5+ messages in thread
From: Martin Peschke @ 2008-09-29 15:30 UTC (permalink / raw)
To: linux-s390, linux-btrace
On Fri, 2008-09-26 at 21:34 +0200, Bastian Blank wrote:
> On Wed, Jul 16, 2008 at 01:24:25PM +0200, Martin Peschke wrote:
> > +#ifdef __KERNEL__
> > + char name[BDEVNAME_SIZE]; /* output */
> > +#else
> > + char name[32]; /* output */
> > +#endif
>
> Bad idea. BDEVNAME_SIZE is not exported and therfor not part of the
> public API. As this defines a userspace API it must not change anyway.
So this should be simply char name[32] both for kernel and user space?
Martin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Patch] include blktrace_api.h in headers_install
@ 2008-09-26 8:26 Jan Blunck
0 siblings, 0 replies; 5+ messages in thread
From: Jan Blunck @ 2008-09-26 8:26 UTC (permalink / raw)
To: linux-btrace
On Wed, Jul 16, Martin Peschke wrote:
> From: Sven Schuetz <sven@linux.vnet.ibm.com>
>
> This header file is of interest for user space programming, i.e.
> for tools that process blktrace data.
>
> We would like to use it for a tool on-top of blktrace which processes
> data provided by blktrace. For this purpose, it would be helpful
> if the blktrace API would make it to /usr/include/linux.
>
> The git tree for the blktrace tools comes with its own copy of this header
> file. I didn't manage to replace that copy with the file generated
> by the patch below yet. A few more cleanups would be needed.
> For example, the blktrace ioctl numbers, which are currently defined in
> usr/include/fs.h, might need to be moved. Should be feasible, though.
>
Any reason why this patch isn't upstream yet?
Regards,
Jan
--
Jan Blunck <jblunck@suse.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-09-29 15:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-16 11:24 [Patch] include blktrace_api.h in headers_install Martin Peschke
2008-09-26 8:50 ` Jens Axboe
2008-09-26 19:34 ` Bastian Blank
2008-09-29 15:30 ` Martin Peschke
-- strict thread matches above, loose matches on Subject: below --
2008-09-26 8:26 Jan Blunck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).