aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xentrace
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-07-15 13:19:26 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-07-15 13:19:26 +0100
commit7eb8d34c180bf88522822ebd487747ad7353335a (patch)
treea1fa4d5eab79c5882ff6e57cb4f37a9a15ce54e0 /tools/xentrace
parent533a2a2773f04d175bda34ea2f0202616b68be2b (diff)
downloadxen-7eb8d34c180bf88522822ebd487747ad7353335a.tar.gz
xen-7eb8d34c180bf88522822ebd487747ad7353335a.tar.bz2
xen-7eb8d34c180bf88522822ebd487747ad7353335a.zip
tools: Declare functions static where they should be, and provide
proper prototypes for others as required. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'tools/xentrace')
-rw-r--r--tools/xentrace/xenctx.c30
-rw-r--r--tools/xentrace/xentrace.c28
2 files changed, 30 insertions, 28 deletions
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index a6f80a4ba4..66e48c6d1f 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -71,7 +71,7 @@ struct symbol {
size_t kernel_stext, kernel_etext, kernel_sinittext, kernel_einittext, kernel_hypercallpage;
-int is_kernel_text(size_t addr)
+static int is_kernel_text(size_t addr)
{
#if defined (__i386__)
if (symbol_table == NULL)
@@ -96,7 +96,8 @@ int is_kernel_text(size_t addr)
return 0;
}
-void free_symbol(struct symbol *symbol)
+#if 0
+static void free_symbol(struct symbol *symbol)
{
if (symbol == NULL)
return;
@@ -104,8 +105,9 @@ void free_symbol(struct symbol *symbol)
free(symbol->name);
free(symbol);
}
+#endif
-void insert_symbol(struct symbol *symbol)
+static void insert_symbol(struct symbol *symbol)
{
static struct symbol *prev = NULL;
struct symbol *s = symbol_table;
@@ -132,7 +134,7 @@ void insert_symbol(struct symbol *symbol)
prev = symbol;
}
-struct symbol *lookup_symbol(size_t address)
+static struct symbol *lookup_symbol(size_t address)
{
struct symbol *s = symbol_table;
@@ -145,7 +147,7 @@ struct symbol *lookup_symbol(size_t address)
return NULL;
}
-void print_symbol(size_t addr)
+static void print_symbol(size_t addr)
{
struct symbol *s;
@@ -163,7 +165,7 @@ void print_symbol(size_t addr)
printf("%s+%#x ", s->name, (unsigned int)(addr - s->address));
}
-void read_symbol_table(const char *symtab)
+static void read_symbol_table(const char *symtab)
{
char line[256];
char *p;
@@ -240,7 +242,7 @@ char *flag_values[22][2] =
{ NULL, "cid" } // 21 Cpuid Identification Flag
};
-void print_flags(uint64_t flags)
+static void print_flags(uint64_t flags)
{
int i;
@@ -253,7 +255,7 @@ void print_flags(uint64_t flags)
printf("\n");
}
-void print_special(unsigned long *regs, const char *name, unsigned int mask)
+static void print_special(unsigned long *regs, const char *name, unsigned int mask)
{
unsigned int i;
@@ -265,7 +267,7 @@ void print_special(unsigned long *regs, const char *name, unsigned int mask)
#endif
#ifdef __i386__
-void print_ctx(vcpu_guest_context_t *ctx1)
+static void print_ctx(vcpu_guest_context_t *ctx1)
{
struct cpu_user_regs *regs = &ctx1->user_regs;
@@ -294,7 +296,7 @@ void print_ctx(vcpu_guest_context_t *ctx1)
}
}
#elif defined(__x86_64__)
-void print_ctx(vcpu_guest_context_t *ctx1)
+static void print_ctx(vcpu_guest_context_t *ctx1)
{
struct cpu_user_regs *regs = &ctx1->user_regs;
@@ -582,7 +584,7 @@ void print_ctx(vcpu_guest_context_t *ctx)
#endif
#ifndef NO_TRANSLATION
-void *map_page(vcpu_guest_context_t *ctx, int vcpu, size_t virt)
+static void *map_page(vcpu_guest_context_t *ctx, int vcpu, size_t virt)
{
static unsigned long previous_mfn = 0;
static void *mapped = NULL;
@@ -609,7 +611,7 @@ void *map_page(vcpu_guest_context_t *ctx, int vcpu, size_t virt)
return (void *)(mapped + offset);
}
-void print_stack(vcpu_guest_context_t *ctx, int vcpu)
+static void print_stack(vcpu_guest_context_t *ctx, int vcpu)
{
struct cpu_user_regs *regs = &ctx->user_regs;
size_t stack = STACK_POINTER(regs);
@@ -699,7 +701,7 @@ void print_stack(vcpu_guest_context_t *ctx, int vcpu)
}
#endif
-void dump_ctx(int vcpu)
+static void dump_ctx(int vcpu)
{
int ret;
vcpu_guest_context_any_t ctx;
@@ -748,7 +750,7 @@ void dump_ctx(int vcpu)
}
}
-void usage(void)
+static void usage(void)
{
printf("usage:\n\n");
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
index aaef3f09fb..29e664ca62 100644
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -68,7 +68,7 @@ static int xc_handle = -1;
static int event_fd = -1;
static int virq_port = -1;
-void close_handler(int signal)
+static void close_handler(int signal)
{
interrupted = 1;
}
@@ -84,7 +84,7 @@ void close_handler(int signal)
* Outputs the trace buffer to a filestream, prepending the CPU and size
* of the buffer write.
*/
-void write_buffer(unsigned int cpu, unsigned char *start, int size,
+static void write_buffer(unsigned int cpu, unsigned char *start, int size,
int total_size, int outfd)
{
struct statvfs stat;
@@ -206,7 +206,7 @@ static void get_tbufs(unsigned long *mfn, unsigned long *size)
*
* Maps the Xen trace buffers them into process address space.
*/
-struct t_buf *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
+static struct t_buf *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
unsigned long size)
{
struct t_buf *tbufs_mapped;
@@ -230,7 +230,7 @@ struct t_buf *map_tbufs(unsigned long tbufs_mfn, unsigned int num,
* @type: the new mask type,0-event mask, 1-cpu mask
*
*/
-void set_mask(uint32_t mask, int type)
+static void set_mask(uint32_t mask, int type)
{
int ret = 0;
@@ -258,7 +258,7 @@ void set_mask(uint32_t mask, int type)
* Initialises an array of pointers to individual trace buffers within the
* mapped region containing all trace buffers.
*/
-struct t_buf **init_bufs_ptrs(void *bufs_mapped, unsigned int num,
+static struct t_buf **init_bufs_ptrs(void *bufs_mapped, unsigned int num,
unsigned long size)
{
int i;
@@ -291,7 +291,7 @@ struct t_buf **init_bufs_ptrs(void *bufs_mapped, unsigned int num,
* mapped in user space. Note that the trace buffer metadata contains machine
* pointers - the array returned allows more convenient access to them.
*/
-unsigned char **init_rec_ptrs(struct t_buf **meta, unsigned int num)
+static unsigned char **init_rec_ptrs(struct t_buf **meta, unsigned int num)
{
int i;
unsigned char **data;
@@ -312,7 +312,7 @@ unsigned char **init_rec_ptrs(struct t_buf **meta, unsigned int num)
/**
* get_num_cpus - get the number of logical CPUs
*/
-unsigned int get_num_cpus(void)
+static unsigned int get_num_cpus(void)
{
xc_physinfo_t physinfo = { 0 };
int ret;
@@ -331,7 +331,7 @@ unsigned int get_num_cpus(void)
/**
* event_init - setup to receive the VIRQ_TBUF event
*/
-void event_init(void)
+static void event_init(void)
{
int rc;
@@ -354,7 +354,7 @@ void event_init(void)
* wait_for_event_or_timeout - sleep for the specified number of milliseconds,
* or until an VIRQ_TBUF event occurs
*/
-void wait_for_event_or_timeout(unsigned long milliseconds)
+static void wait_for_event_or_timeout(unsigned long milliseconds)
{
int rc;
struct pollfd fd = { .fd = event_fd,
@@ -394,7 +394,7 @@ void wait_for_event_or_timeout(unsigned long milliseconds)
* monitor_tbufs - monitor the contents of tbufs and output to a file
* @logfile: the FILE * representing the file to log to
*/
-int monitor_tbufs(int outfd)
+static int monitor_tbufs(int outfd)
{
int i;
@@ -512,7 +512,7 @@ int monitor_tbufs(int outfd)
const char *program_version = "xentrace v1.2";
const char *program_bug_address = "<mark.a.williamson@intel.com>";
-void usage(void)
+static void usage(void)
{
#define USAGE_STR \
"Usage: xentrace [OPTION...] [output file]\n" \
@@ -554,7 +554,7 @@ void usage(void)
}
/* convert the argument string pointed to by arg to a long int representation */
-long argtol(const char *restrict arg, int base)
+static long argtol(const char *restrict arg, int base)
{
char *endp;
long val;
@@ -574,7 +574,7 @@ long argtol(const char *restrict arg, int base)
return val;
}
-int parse_evtmask(char *arg)
+static int parse_evtmask(char *arg)
{
/* search filtering class */
if (strcmp(arg, "gen") == 0){
@@ -595,7 +595,7 @@ int parse_evtmask(char *arg)
}
/* parse command line arguments */
-void parse_args(int argc, char **argv)
+static void parse_args(int argc, char **argv)
{
int option;
static struct option long_options[] = {