summaryrefslogtreecommitdiff
path: root/src/pmdas/hotproc/fixpmns.awk
blob: bf2d56826a6f2e8ae637af79b2fe42f7e944ab9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# states
#  0		nothing interesting is happening, looking for proc { ... }
#  1		inside proc { ... }; want to copy all lines except
#		"nprocs" metric that does not come from here for the
#		hotproc PMDA
#  2		looking for proc.foo { ... }
#  3		inside proc.foo { ... }; want to copy all lines
#
BEGIN	{ print "/*"
	  print " * Hotproc Performance Metric Domain (PMD) Identifiers"
	  print " * (generated from pmns for hotproc and proc metrics)"
	  print " */"
	  print ""
	  print "hotproc {"
	  print "    nprocs	HOTPROC:100:0"
	  print "    cpuburn	HOTPROC:102:0"
	  print "    total"
	  print "    predicate"
	  print "    control"
	  state = 0
	}

state == 0 && /^proc /	{ state = 1; next }

state == 1 && /nprocs/	{ next }

state == 1 && /^}/	{ print; print ""; state = 2; next }

state == 1		{ print }

state == 2 && /^proc\./	{ state = 3 }

state == 3 && /^}/	{ print; print ""; state = 2; next }

state == 3		{ print }