File: papi_events_table.sh

package info (click to toggle)
papi 5.7.0+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 9,856 kB
  • sloc: ansic: 93,265; fortran: 3,338; xml: 2,460; makefile: 815; sh: 290
file content (19 lines) | stat: -rw-r--r-- 466 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
#
#	Transform the papi_events.csv file into a static table.
#
#	tr "\r" "\n" |		# convert CR to LF
#	tr -s "\n" |		# convert LFLF to LF
#	tr "\"" "'" |		# convert " to '
#	sed 's/^/"/' | \	# insert " at beginning of line
#	sed 's/$/\\n\"/'	# insert LF" at end of line
#
# print "#define STATIC_PAPI_EVENTS_TABLE 1"
echo "static char *papi_events_table ="
cat $1 | \
	tr "\r" "\n" |
	tr -s "\n" |
	tr "\"" "'" |
	sed 's/^/"/' | \
	sed 's/$/\\n\"/'
echo ";"