Split syscalls headers and tools
[lttng-modules.git] / tools / syscalls / lttng-syscalls-generate-headers.sh
CommitLineData
2879dbbc 1#!/bin/bash
5fee13fd
MD
2
3# Generate system call probe description macros from syscall metadata dump file.
eafcf0ad 4# The resulting header will be written in the headers subdirectory, in a file name
2879dbbc 5# based on the name of the input file.
eafcf0ad 6#
5fee13fd 7# example usage:
25631135 8#
9497697f
JG
9# lttng-syscalls-generate-headers.sh <type> <input_dir> <input_filename_in_dir> <arch_name> <bitness>
10# lttng-syscalls-generate-headers.sh integers 3.0.4 x86-64-syscalls x86-64 64
11# lttng-syscalls-generate-headers.sh pointers 3.0.4 x86-64-syscalls x86-64 64
5fee13fd 12
25631135 13CLASS=$1
6314c2d3 14VERSIONDIR=$2
25631135 15INPUTFILE=$3
9497697f
JG
16ARCH_NAME=$4
17BITNESS=$5
b03cf820 18OUTPUTDIR=$6
5fee13fd 19
b03cf820 20if [ "$VERSIONDIR" = "" ]; then
2879dbbc 21 echo "Error: Please specify input directory as second argument" >&2
94f9e233
MD
22 exit 1
23fi
24
b03cf820 25if [ "$INPUTFILE" = "" ]; then
2879dbbc 26 echo "Error: Please specify input file as third argument" >&2
94f9e233
MD
27 exit 1
28fi
29
b03cf820 30if [ "$BITNESS" != "32" ] && [ "$BITNESS" != "64" ]; then
2879dbbc 31 echo "Error: Please specify bitness as fourth argument (\"32\" or \"64\")" >&2
94f9e233
MD
32 exit 1
33fi
34
b03cf820 35if [ "$ARCH_NAME" = "" ]; then
9497697f
JG
36 echo "Error: Please specify the architecture name as fourth argument" >&2
37 exit 1
38fi
39
b03cf820
MJ
40if [ "$OUTPUTDIR" = "" ]; then
41 echo "Error: Please specify output directory as fifth argument" >&2
42 exit 1
43fi
44
2879dbbc
MJ
45# Abort on error and undefined variable
46set -eu
5fee13fd 47
b03cf820
MJ
48INPUT=${VERSIONDIR}/${INPUTFILE}
49HEADER="${OUTPUTDIR}/${INPUTFILE}_${CLASS}.h"
50
2879dbbc
MJ
51# Create temp files
52SRCFILE=$(mktemp)
53TMPFILE=$(mktemp)
5fee13fd 54
2879dbbc
MJ
55# Delete temp files on exit
56trap 'rm -f "${SRCFILE}" "${TMPFILE}"' EXIT
57
58cp "${INPUT}" "${SRCFILE}"
59
60## Cleanup the input file
61# Remove the dmesg timestamp if present
62perl -pi -e 's/^\[.*\] //g' "${SRCFILE}"
63# Remove the 'sys_' prefix from syscall names
64perl -pi -e 's/^syscall sys_([^ ]*)/syscall $1/g' "${SRCFILE}"
65# Remove the user attribute from arguments
66sed -i 's/ __attribute__((user))//g' "${SRCFILE}"
5fee13fd
MD
67
68#Filter
69
25631135
MD
70if [ "$CLASS" = integers ]; then
71 #select integers and no-args.
177b3692 72 CLASSCAP=INTEGERS
2879dbbc
MJ
73 grep -v "\\*\|cap_user_header_t" "${SRCFILE}" > "${TMPFILE}"
74 mv "${TMPFILE}" "${SRCFILE}"
75elif [ "$CLASS" = pointers ]; then
25631135 76 #select system calls using pointers.
177b3692 77 CLASSCAP=POINTERS
2879dbbc
MJ
78 grep "\\*\|cap_#user_header_t" "${SRCFILE}" > "${TMPFILE}"
79 mv "${TMPFILE}" "${SRCFILE}"
80else
81 echo "Error: Please specify \"integers\" or \"pointers\" as first argument" >&2
94f9e233
MD
82 exit 1
83fi
84
5fee13fd 85
b7cdc182 86echo "/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) */
b03cf820 87/* SPDX-FileCopyrightText: $(date +%Y) EfficiOS Inc. */
2879dbbc
MJ
88
89/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */
90
6314c2d3
MJ
91/* Generated from ${INPUTFILE} ${VERSIONDIR} */
92
2879dbbc 93#ifndef CREATE_SYSCALL_TABLE
054f2ed3 94
177b3692
MD
95#if !defined(_TRACE_SYSCALLS_${CLASSCAP}_H) || defined(TRACE_HEADER_MULTI_READ)
96#define _TRACE_SYSCALLS_${CLASSCAP}_H
5fee13fd 97
3b4aafcb 98#include <lttng/tracepoint-event.h>
5fee13fd 99#include <linux/syscalls.h>
1dc9d1cf 100#include \"${INPUTFILE}_${CLASS}_override.h\"
daaf627a 101#include \"syscalls_${CLASS}_override.h\"
2879dbbc 102" > "${HEADER}"
5fee13fd 103
25631135
MD
104if [ "$CLASS" = integers ]; then
105
2879dbbc 106 NRARGS=0
fc4f7161 107
2879dbbc
MJ
108 # shellcheck disable=SC2129
109 printf \
110'#ifdef SC_ENTER
111SC_LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(syscalls_noargs,
112 TP_FIELDS()
113)
114' >> "${HEADER}"
f7bdf4db 115
2879dbbc
MJ
116 # shellcheck disable=SC2026
117 grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " "${SRCFILE}" | \
118 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
177b3692
MD
119'types: \(([^)]*)\) '\
120'args: \(([^)]*)\)/'\
644d6e9c 121'#ifndef OVERRIDE_'"${BITNESS}"'_$1\n'\
cb3ef14c 122'SC_LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(syscalls_noargs, $1)\n'\
2879dbbc 123'#endif/g' >> "${HEADER}"
f7bdf4db 124
2879dbbc 125 printf '#else /* #ifdef SC_ENTER */\n' >> "${HEADER}"
fc4f7161 126
2879dbbc
MJ
127 # shellcheck disable=SC2026
128 grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " "${SRCFILE}" | \
129 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
fc4f7161
MD
130'types: \(([^)]*)\) '\
131'args: \(([^)]*)\)/'\
644d6e9c 132'#ifndef OVERRIDE_'"${BITNESS}"'_$1\n'\
cb3ef14c 133'SC_LTTNG_TRACEPOINT_EVENT($1,\n'\
fc4f7161
MD
134' TP_PROTO(sc_exit(long ret)),\n'\
135' TP_ARGS(sc_exit(ret)),\n'\
57ede728 136' TP_FIELDS(sc_exit(ctf_integer(long, ret, ret)))\n'\
fc4f7161 137')\n'\
2879dbbc 138'#endif/g' >> "${HEADER}"
fc4f7161 139
2879dbbc 140 printf '#endif /* else #ifdef SC_ENTER */\n' >> "${HEADER}"
fc4f7161 141
25631135 142fi
5fee13fd 143
177b3692 144
5fee13fd
MD
145# types: 4
146# args 5
147
148NRARGS=1
2879dbbc
MJ
149grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " "${SRCFILE}" | while read -r LINE; do
150 SC_NAME=$(echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) .*/$1/g')
9497697f 151 ARG1=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 1)
2879dbbc
MJ
152
153 echo Syscall: "${SC_NAME}" "${ARG1}"
154
155 # shellcheck disable=SC2026
156 echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
177b3692
MD
157'types: \(([^)]*)\) '\
158'args: \(([^)]*)\)/'\
644d6e9c 159'#ifndef OVERRIDE_'"${BITNESS}"'_$1\n'\
cb3ef14c 160'SC_LTTNG_TRACEPOINT_EVENT($1,\n'\
fc4f7161
MD
161' TP_PROTO(sc_exit(long ret,) $4 $5),\n'\
162' TP_ARGS(sc_exit(ret,) $5),\n'\
57ede728 163' TP_FIELDS(sc_exit(ctf_integer(long, ret, ret)) '"${ARG1}"'(ctf_integer($4, $5, $5)))\n'\
1dc9d1cf 164')\n'\
2879dbbc
MJ
165'#endif/g' >> "${HEADER}"
166done
5fee13fd
MD
167
168# types: 4 5
169# args 6 7
170
171NRARGS=2
2879dbbc
MJ
172grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " "${SRCFILE}" | while read -r LINE; do
173 SC_NAME=$(echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) .*/$1/g')
9497697f
JG
174 ARG1=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 1)
175 ARG2=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 2)
2879dbbc
MJ
176
177 echo Syscall: "${SC_NAME}" "${ARG1}" "${ARG2}"
178
179 # shellcheck disable=SC2026
180 echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
177b3692
MD
181'types: \(([^,]*), ([^)]*)\) '\
182'args: \(([^,]*), ([^)]*)\)/'\
644d6e9c 183'#ifndef OVERRIDE_'"${BITNESS}"'_$1\n'\
cb3ef14c 184'SC_LTTNG_TRACEPOINT_EVENT($1,\n'\
fc4f7161
MD
185' TP_PROTO(sc_exit(long ret,) $4 $6, $5 $7),\n'\
186' TP_ARGS(sc_exit(ret,) $6, $7),\n'\
57ede728 187' TP_FIELDS(sc_exit(ctf_integer(long, ret, ret)) '"${ARG1}"'(ctf_integer($4, $6, $6)) '"${ARG2}"'(ctf_integer($5, $7, $7)))\n'\
1dc9d1cf 188')\n'\
2879dbbc
MJ
189'#endif/g' >> "${HEADER}"
190done
5fee13fd
MD
191
192# types: 4 5 6
193# args 7 8 9
194
195NRARGS=3
2879dbbc
MJ
196grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " "${SRCFILE}" | while read -r LINE; do
197 SC_NAME=$(echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) .*/$1/g')
9497697f
JG
198 ARG1=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 1)
199 ARG2=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 2)
200 ARG3=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 3)
2879dbbc
MJ
201
202 echo Syscall: "${SC_NAME}" "${ARG1}" "${ARG2}" "${ARG3}"
203
204 # shellcheck disable=SC2026
205 echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
177b3692
MD
206'types: \(([^,]*), ([^,]*), ([^)]*)\) '\
207'args: \(([^,]*), ([^,]*), ([^)]*)\)/'\
644d6e9c 208'#ifndef OVERRIDE_'"${BITNESS}"'_$1\n'\
cb3ef14c 209'SC_LTTNG_TRACEPOINT_EVENT($1,\n'\
fc4f7161
MD
210' TP_PROTO(sc_exit(long ret,) $4 $7, $5 $8, $6 $9),\n'\
211' TP_ARGS(sc_exit(ret,) $7, $8, $9),\n'\
57ede728 212' TP_FIELDS(sc_exit(ctf_integer(long, ret, ret)) '"${ARG1}"'(ctf_integer($4, $7, $7)) '"${ARG2}"'(ctf_integer($5, $8, $8)) '"${ARG3}"'(ctf_integer($6, $9, $9)))\n'\
1dc9d1cf 213')\n'\
2879dbbc
MJ
214'#endif/g' >> "${HEADER}"
215done
5fee13fd
MD
216
217
218# types: 4 5 6 7
219# args 8 9 10 11
220
221NRARGS=4
2879dbbc
MJ
222grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " "${SRCFILE}" | while read -r LINE; do
223 SC_NAME=$(echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) .*/$1/g')
9497697f
JG
224 ARG1=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 1)
225 ARG2=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 2)
226 ARG3=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 3)
227 ARG4=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 4)
2879dbbc
MJ
228
229 echo Syscall: "${SC_NAME}" "${ARG1}" "${ARG2}" "${ARG3}" "${ARG4}"
230
231 # shellcheck disable=SC2026
232 echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
177b3692
MD
233'types: \(([^,]*), ([^,]*), ([^,]*), ([^)]*)\) '\
234'args: \(([^,]*), ([^,]*), ([^,]*), ([^)]*)\)/'\
644d6e9c 235'#ifndef OVERRIDE_'"${BITNESS}"'_$1\n'\
cb3ef14c 236'SC_LTTNG_TRACEPOINT_EVENT($1,\n'\
fc4f7161
MD
237' TP_PROTO(sc_exit(long ret,) $4 $8, $5 $9, $6 $10, $7 $11),\n'\
238' TP_ARGS(sc_exit(ret,) $8, $9, $10, $11),\n'\
57ede728 239' TP_FIELDS(sc_exit(ctf_integer(long, ret, ret)) '"${ARG1}"'(ctf_integer($4, $8, $8)) '"${ARG2}"'(ctf_integer($5, $9, $9)) '"${ARG3}"'(ctf_integer($6, $10, $10)) '"${ARG4}"'(ctf_integer($7, $11, $11)))\n'\
1dc9d1cf 240')\n'\
2879dbbc
MJ
241'#endif/g' >> "${HEADER}"
242done
5fee13fd
MD
243
244# types: 4 5 6 7 8
245# args 9 10 11 12 13
246
247NRARGS=5
2879dbbc
MJ
248grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " "${SRCFILE}" | while read -r LINE; do
249 SC_NAME=$(echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) .*/$1/g')
9497697f
JG
250 ARG1=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 1)
251 ARG2=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 2)
252 ARG3=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 3)
253 ARG4=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 4)
254 ARG5=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 5)
2879dbbc
MJ
255
256 echo Syscall: "${SC_NAME}" "${ARG1}" "${ARG2}" "${ARG3}" "${ARG4}" "${ARG5}"
257
258 # shellcheck disable=SC2026
259 echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
177b3692
MD
260'types: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^)]*)\) '\
261'args: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^)]*)\)/'\
644d6e9c 262'#ifndef OVERRIDE_'"${BITNESS}"'_$1\n'\
cb3ef14c 263'SC_LTTNG_TRACEPOINT_EVENT($1,\n'\
fc4f7161
MD
264' TP_PROTO(sc_exit(long ret,) $4 $9, $5 $10, $6 $11, $7 $12, $8 $13),\n'\
265' TP_ARGS(sc_exit(ret,) $9, $10, $11, $12, $13),\n'\
57ede728 266' TP_FIELDS(sc_exit(ctf_integer(long, ret, ret)) '"${ARG1}"'(ctf_integer($4, $9, $9)) '"${ARG2}"'(ctf_integer($5, $10, $10)) '"${ARG3}"'(ctf_integer($6, $11, $11)) '"${ARG4}"'(ctf_integer($7, $12, $12)) '"${ARG5}"'(ctf_integer($8, $13, $13)))\n'\
1dc9d1cf 267')\n'\
2879dbbc
MJ
268'#endif/g' >> "${HEADER}"
269done
5fee13fd
MD
270
271
272# types: 4 5 6 7 8 9
273# args 10 11 12 13 14 15
274
275NRARGS=6
2879dbbc
MJ
276grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " "${SRCFILE}" | while read -r LINE; do
277 SC_NAME=$(echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) .*/$1/g')
9497697f
JG
278 ARG1=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 1)
279 ARG2=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 2)
280 ARG3=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 3)
281 ARG4=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 4)
282 ARG5=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 5)
283 ARG6=$(./lttng-get-syscall-inout.sh "${ARCH_NAME}" "${SC_NAME}" 6)
2879dbbc
MJ
284
285 echo Syscall: "${SC_NAME}" "${ARG1}" "${ARG2}" "${ARG3}" "${ARG4}" "${ARG5}" "${ARG6}"
286
287 # shellcheck disable=SC2026
288 echo "${LINE}" | perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) '\
177b3692
MD
289'types: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^\)]*)\) '\
290'args: \(([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^,]*), ([^\)]*)\)/'\
644d6e9c 291'#ifndef OVERRIDE_'"${BITNESS}"'_$1\n'\
cb3ef14c 292'SC_LTTNG_TRACEPOINT_EVENT($1,\n'\
fc4f7161
MD
293' TP_PROTO(sc_exit(long ret,) $4 $10, $5 $11, $6 $12, $7 $13, $8 $14, $9 $15),\n'\
294' TP_ARGS(sc_exit(ret,) $10, $11, $12, $13, $14, $15),\n'\
57ede728 295' TP_FIELDS(sc_exit(ctf_integer(long, ret, ret)) '"${ARG1}"'(ctf_integer($4, $10, $10)) '"${ARG2}"'(ctf_integer($5, $11, $11)) '"${ARG3}"'(ctf_integer($6, $12, $12)) '"${ARG4}"'(ctf_integer($7, $13, $13)) '"${ARG5}"'(ctf_integer($8, $14, $14)) '"${ARG6}"'(ctf_integer($9, $15, $15)))\n'\
1dc9d1cf 296')\n'\
2879dbbc
MJ
297'#endif/g' >> "${HEADER}"
298done
5fee13fd 299
9b6d7a0c
MD
300# Macro for tracing syscall table
301
054f2ed3 302echo \
5fee13fd 303"
177b3692 304#endif /* _TRACE_SYSCALLS_${CLASSCAP}_H */
5fee13fd
MD
305
306/* This part must be outside protection */
3b4aafcb 307#include <lttng/define_trace.h>
054f2ed3
MD
308
309#else /* CREATE_SYSCALL_TABLE */
054f2ed3 310
cac8f1aa 311#include \"${INPUTFILE}_${CLASS}_override.h\"
daaf627a 312#include \"syscalls_${CLASS}_override.h\"
2879dbbc 313" >> "${HEADER}"
f7bdf4db
MD
314
315NRARGS=0
f7bdf4db 316
25631135 317if [ "$CLASS" = integers ]; then
2879dbbc 318 #noargs
fc4f7161 319
2879dbbc
MJ
320 # shellcheck disable=SC2129
321 printf '#ifdef SC_ENTER\n' >> "${HEADER}"
fc4f7161 322
2879dbbc
MJ
323 # shellcheck disable=SC2026
324 grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " "${SRCFILE}" | \
325 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) .*$/'\
644d6e9c
MD
326'#ifndef OVERRIDE_TABLE_'"${BITNESS}"'_$1\n'\
327'TRACE_SYSCALL_TABLE\(syscalls_noargs, $1, $2, $3\)\n'\
2879dbbc 328'#endif/g' >> "${HEADER}"
fc4f7161 329
2879dbbc 330 printf '#else /* #ifdef SC_ENTER */\n' >> "${HEADER}"
fc4f7161 331
2879dbbc
MJ
332 # shellcheck disable=SC2026
333 grep "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " "${SRCFILE}" | \
334 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) .*$/'\
644d6e9c
MD
335'#ifndef OVERRIDE_TABLE_'"${BITNESS}"'_$1\n'\
336'TRACE_SYSCALL_TABLE($1, $1, $2, $3)\n'\
2879dbbc 337'#endif/g' >> "${HEADER}"
fc4f7161 338
2879dbbc 339 printf '#endif /* else #ifdef SC_ENTER */\n' >> "${HEADER}"
25631135 340fi
f7bdf4db
MD
341
342#others.
2879dbbc
MJ
343# shellcheck disable=SC2026
344grep -v "^syscall [^ ]* nr [^ ]* nbargs ${NRARGS} " "${SRCFILE}" | \
345 perl -p -e 's/^syscall ([^ ]*) nr ([^ ]*) nbargs ([^ ]*) .*$/'\
644d6e9c
MD
346'#ifndef OVERRIDE_TABLE_'"${BITNESS}"'_$1\n'\
347'TRACE_SYSCALL_TABLE($1, $1, $2, $3)\n'\
2879dbbc 348'#endif/g' >> "${HEADER}"
054f2ed3 349
2879dbbc 350printf '\n#endif /* CREATE_SYSCALL_TABLE */\n' >> "${HEADER}"
5fee13fd 351
e374aaf1
MD
352#fields names: ...char * type with *name* or *file* or *path* or *root*
353# or *put_old* or *type*
2879dbbc
MJ
354perl -pi -e 's/ctf_integer\(([^,)]*char \*), ([^\)]*)(name|file|path|root|put_old|type)([^\)]*)\)/ctf_user_string($2$3$4)/g' \
355 "${HEADER}"
d0b4f04b
MD
356
357#prettify addresses heuristics.
358#field names with addr or ptr
2879dbbc
MJ
359perl -pi -e 's/ctf_integer\(([^,)]*), ([^,)]*addr|[^,)]*ptr)([^),]*)\)/ctf_integer_hex($1, $2$3, $2$3)/g' \
360 "${HEADER}"
f4c4a6ae 361
d0b4f04b 362#field types ending with '*'
2879dbbc
MJ
363perl -pi -e 's/ctf_integer\(([^,)]*\*), ([^),]*)\)/ctf_integer_hex($1, $2, $2)/g' "${HEADER}"
364
365# EOF
This page took 0.135618 seconds and 4 git commands to generate.