From 8c235ce57600584d3126ad86520b4fb44765c8ec Mon Sep 17 00:00:00 2001 From: hunt Date: Wed, 14 Mar 2007 16:13:33 +0000 Subject: 2007-03-14 Martin Hunt * bench2/bench.rb: Updated to work with new transport and new itest.c. * bench2/Makefile: Updated for new itest.c * bench2/itest.c: Rewritten to use multiple threads and automatically divide the workload among the threads. * print.c (_stp_print_flush): Move to print_new.c and print_old.c. * print_new.c: New file containing _stp_print_flush() for the new transport. * print_old.c: Ditto for old transport. * runtime.h (STP_OLD_TRANSPORT): Define (errk): Define. (MAXSTRINGLEN): Define if not already defined. * io.c (_stp_vlog): Use _stp_ctl_write(). --- runtime/runtime.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'runtime/runtime.h') diff --git a/runtime/runtime.h b/runtime/runtime.h index 4d741cf4..6fa168dc 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -1,5 +1,5 @@ /* main header file - * Copyright (C) 2005, 2006 Red Hat Inc. + * Copyright (C) 2005-2007 Red Hat Inc. * Copyright (C) 2005, 2006 Intel Corporation. * * This file is part of systemtap, and is free software. You can @@ -10,9 +10,6 @@ #ifndef _RUNTIME_H_ #define _RUNTIME_H_ -/** @file runtime.h - * @brief Main include file for runtime functions. - */ #include #include @@ -33,6 +30,11 @@ #include #include +/* the new transport requires debugfs and a newer relayfs */ +#if !defined (CONFIG_DEBUG_FS) || (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)) +#define STP_OLD_TRANSPORT +#endif + #ifndef for_each_cpu #define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) #endif @@ -51,18 +53,17 @@ static void _stp_dbug (const char *func, int line, const char *fmt, ...); #define dbug(args...) ; #define kbug(args...) ; #endif /* DEBUG */ +#define errk(args...) {printk("Systemtap Error at %s:%d ",__FUNCTION__, __LINE__); printk(args); } /* atomic globals */ static atomic_t _stp_transport_failures = ATOMIC_INIT (0); -#ifdef STP_RELAYFS static struct { atomic_t ____cacheline_aligned_in_smp seq; } _stp_seq = { ATOMIC_INIT (0) }; #define _stp_seq_inc() (atomic_inc_return(&_stp_seq.seq)) -#endif /* RELAYFS */ /* TEST_MODE is always defined by systemtap */ #ifdef TEST_MODE @@ -72,6 +73,10 @@ static struct #define TRYLOCKDELAY 100 #endif +#ifndef MAXSTRINGLEN +#define MAXSTRINGLEN 128 +#endif + #include "alloc.c" #include "print.c" #include "string.c" -- cgit