patch-xuvmstat_c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. $OpenBSD: patch-xuvmstat_c,v 1.6 2017/04/24 02:21:22 jca Exp $
  2. --- xuvmstat.c.orig Fri Sep 9 15:38:48 2005
  3. +++ xuvmstat.c Mon Apr 24 04:19:26 2017
  4. @@ -24,16 +24,15 @@
  5. * xuvmstat.c
  6. */
  7. +#include <err.h>
  8. #include <errno.h>
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include <unistd.h>
  12. #include <sys/param.h>
  13. #include <sys/errno.h>
  14. +#include <sys/sysctl.h>
  15. #include <sys/time.h>
  16. -#if (__NetBSD_Version__ < 105000000)
  17. -#include <vm/vm.h>
  18. -#endif
  19. #include <uvm/uvm_extern.h>
  20. #include <X11/Xlib.h>
  21. #include <X11/Xutil.h>
  22. @@ -46,12 +45,14 @@ void redraw __P((struct xdpy *, Window, GC, int));
  23. u_long black, white, red, green, blue, magenta, orange, purple;
  24. XFontStruct *fnt_fixed, *fnt_8x13bold;
  25. +#define cexp curexp
  26. struct uvmexp cexp, oexp; /* current, old */
  27. struct timeval tv, otv;
  28. struct graph *gp_faults, *gp_traps, *gp_intrs, *gp_ctx;
  29. #define WIDTH 300
  30. +int
  31. main(argc, argv)
  32. int argc;
  33. @@ -106,7 +107,7 @@ char **argv;
  34. gettimeofday(&otv, NULL);
  35. {
  36. - int count = 0, xfd = ConnectionNumber(xdpy.dpy), retval;
  37. + int xfd = ConnectionNumber(xdpy.dpy), retval;
  38. struct timeval now, incr, ping, timer;
  39. XEvent event;
  40. @@ -154,6 +155,8 @@ char **argv;
  41. XFreeFont(xdpy.dpy, fnt_fixed);
  42. XCloseDisplay(xdpy.dpy);
  43. +
  44. + return (0);
  45. }
  46. /*
  47. @@ -214,6 +217,7 @@ int was_timeout;
  48. vals, colors, white);
  49. }
  50. +#ifdef notyet
  51. y += 8;
  52. {
  53. static char *names[] = { "file", "anon", "exec", "free", "kernel" };
  54. @@ -237,6 +241,7 @@ int was_timeout;
  55. y = draw_barbox(xdpy, win, gc, fnt_fixed, 5, 295, y, 5, cexp.npages, names,
  56. vals, colors, white);
  57. }
  58. +#endif
  59. y += 8;
  60. @@ -353,8 +358,8 @@ int was_timeout;
  61. static u_long color[3];
  62. init = 1;
  63. before[0] = &oexp.swtch; after[0] = &cexp.swtch; color[0] = black;
  64. - before[1] = &oexp.swapins; after[1] = &cexp.swapins; color[1] = green;
  65. - before[2] = &oexp.swapouts; after[2] = &cexp.swapouts; color[2] = red;
  66. + before[1] = &oexp.pgswapin; after[1] = &cexp.pgswapin; color[1] = green;
  67. + before[2] = &oexp.pgswapout; after[2] = &cexp.pgswapout; color[2] = red;
  68. gp_ctx = create_graph(3, "SWITCH/SWAP", names, before, after, color, white);
  69. }