diff options
author | hunt <hunt> | 2007-03-18 18:19:26 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-03-18 18:19:26 +0000 |
commit | 56bae3425ce425d5f0424887caa77d95a88b9803 (patch) | |
tree | eb67e663f01b3378af7f4aaa1fc66dc57aa66fe7 /runtime/staprun/staprun.h | |
parent | 3d48c9833362aabc5faacb1f237e9914b794a247 (diff) | |
download | systemtap-steved-56bae3425ce425d5f0424887caa77d95a88b9803.tar.gz systemtap-steved-56bae3425ce425d5f0424887caa77d95a88b9803.tar.xz systemtap-steved-56bae3425ce425d5f0424887caa77d95a88b9803.zip |
2007-03-18 Martin Hunt <hunt@redhat.com>
* staprun.h (VERSION_CMD): Command to use for version check.
Changes to support runtime decision on new or old transport.
* mainloop.c (init_staprun): Check the kernel version at runtime
instead of at compile time.
(cleanup_and_exit): Call the correct relayfs close function.
(stp_main_loop): Call the correct relayfs init function.
* relay.c: Remove ifdef wrapper. File is always compiled and used
if the kernel version is appropriate.
* relay_old.c: Ditto.
Diffstat (limited to 'runtime/staprun/staprun.h')
-rw-r--r-- | runtime/staprun/staprun.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/runtime/staprun/staprun.h b/runtime/staprun/staprun.h index d8664802..7a3fd00c 100644 --- a/runtime/staprun/staprun.h +++ b/runtime/staprun/staprun.h @@ -34,21 +34,24 @@ #include <sys/statfs.h> #include <linux/version.h> -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) +#ifdef DEBUG +#define dbug(args...) {fprintf(stderr,"%s:%d ",__FUNCTION__, __LINE__); fprintf(stderr,args); } +#else +#define dbug(args...) ; +#endif /* DEBUG */ + +/* we define this so we are compatible with old transport, but we don't have to use it. */ #define STP_OLD_TRANSPORT -#endif #include "../transport/transport_msgs.h" +/* command to check system's kernel version */ +/* KERNEL_VERSION(2.6.15) = 132623 */ +#define VERSION_CMD "uname -r | awk \'{split($1,a,\".\"); split(a[3],b,\"-\"); exit (a[1]*65536+a[2]*256+b[1] <= 132623)}\'" +extern int use_old_transport; #define RELAYFS_MAGIC 0xF0B4A981 #define DEBUGFS_MAGIC 0x64626720 -#ifdef DEBUG -#define dbug(args...) {fprintf(stderr,"%s:%d ",__FUNCTION__, __LINE__); fprintf(stderr,args); } -#else -#define dbug(args...) ; -#endif /* DEBUG */ - /* * function prototypes */ @@ -59,9 +62,11 @@ void cleanup_and_exit (int); int do_module(void *); void do_kernel_symbols(void); int init_ctl_channel(void); +void close_ctl_channel(void); int init_relayfs(struct _stp_msg_trans *); void close_relayfs(void); -void close_ctl_channel(void); +int init_oldrelayfs(struct _stp_msg_trans *); +void close_oldrelayfs(void); /* * variables @@ -87,5 +92,5 @@ extern gid_t cmd_gid; /* maximum number of CPUs we can handle */ #define NR_CPUS 256 -/* output fd's (percpu) */ +/* relay*.c uses these */ extern int out_fd[NR_CPUS]; |