ia64/xen-unstable

changeset 9272:f6feefcd1046

[IA64] postat tool

Small utility to display and clear privop statistics.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Thu Mar 16 12:13:23 2006 -0700 (2006-03-16)
parents d75f733f328c
children cd15ba9aa1cc
files xen/arch/ia64/tools/privop/Makefile xen/arch/ia64/tools/privop/pohcalls.S xen/arch/ia64/tools/privop/postat.c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xen/arch/ia64/tools/privop/Makefile	Thu Mar 16 12:13:23 2006 -0700
     1.3 @@ -0,0 +1,11 @@
     1.4 +CC=gcc
     1.5 +CFLAGS=-O -Wall
     1.6 +
     1.7 +all: postat
     1.8 +
     1.9 +postat: postat.c pohcalls.o
    1.10 +
    1.11 +clean:
    1.12 +	$(RM) -f *.o postat *.s *~
    1.13 +
    1.14 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/xen/arch/ia64/tools/privop/pohcalls.S	Thu Mar 16 12:13:23 2006 -0700
     2.3 @@ -0,0 +1,30 @@
     2.4 +	.file	"hypercall.S"
     2.5 +	.pred.safe_across_calls p1-p5,p16-p63
     2.6 +	.text
     2.7 +	.align 16
     2.8 +	.global dump_privop_counts#
     2.9 +	.proc dump_privop_counts#
    2.10 +dump_privop_counts:
    2.11 +	.prologue
    2.12 +	.body
    2.13 +	mov r2 = 0xffff
    2.14 +	;;
    2.15 +	break 0x1000
    2.16 +	;; 
    2.17 +	br.ret.sptk.many b0
    2.18 +	;;
    2.19 +	.endp dump_privop_counts#
    2.20 +	.align 16
    2.21 +	.global zero_privop_counts#
    2.22 +	.proc zero_privop_counts#
    2.23 +zero_privop_counts:
    2.24 +	.prologue
    2.25 +	.body
    2.26 +	mov r2 = 0xfffe
    2.27 +	;;
    2.28 +	break 0x1000
    2.29 +	;; 
    2.30 +	br.ret.sptk.many b0
    2.31 +	;;
    2.32 +	.endp zero_privop_counts#
    2.33 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/xen/arch/ia64/tools/privop/postat.c	Thu Mar 16 12:13:23 2006 -0700
     3.3 @@ -0,0 +1,27 @@
     3.4 +#include <stdio.h>
     3.5 +#include <string.h>
     3.6 +
     3.7 +extern int dump_privop_counts (char *buf, int len);
     3.8 +
     3.9 +extern int zero_privop_counts (char *buf, int len);
    3.10 +
    3.11 +int
    3.12 +main (int argc, char *argv[])
    3.13 +{
    3.14 +  static char buf[8192];
    3.15 +  int res;
    3.16 +
    3.17 +  if (argc == 1)
    3.18 +    res = dump_privop_counts (buf, sizeof (buf));
    3.19 +  else if (argc == 2 && strcmp (argv[1], "--clear") == 0)
    3.20 +    res = zero_privop_counts (buf, sizeof (buf));
    3.21 +  else
    3.22 +    {
    3.23 +      printf ("usage: %s [--clear]\n", argv[0]);
    3.24 +      return 1;
    3.25 +    }
    3.26 +  printf ("res=%d\n", res);
    3.27 +  fputs (buf, stdout);
    3.28 +
    3.29 +  return 0;
    3.30 +}