aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-03-31 21:39:16 -0400
committerMike Frysinger <vapier@gentoo.org>2009-04-05 03:53:58 -0400
commit8528e918e24c22779e6bf802794e99f1418ec4ba (patch)
tree4f8c45858e980a4a4f34fee82b3a96fc27aafc65 /scripts
parentbump to sandbox-1.8 (diff)
downloadsandbox-8528e918e24c22779e6bf802794e99f1418ec4ba.tar.gz
sandbox-8528e918e24c22779e6bf802794e99f1418ec4ba.tar.bz2
sandbox-8528e918e24c22779e6bf802794e99f1418ec4ba.zip
libsandbox: enable tracing for multiple personalities
Initial support for tracing non-default personalities. For example, tracing a 32bit binary from a 64bit environment. URL: http://bugs.gentoo.org/264399 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reported-by: Patrick Lauer <patrick@gentoo.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gen_trace_header.awk37
1 files changed, 28 insertions, 9 deletions
diff --git a/scripts/gen_trace_header.awk b/scripts/gen_trace_header.awk
index 6b99966..75f4f02 100644
--- a/scripts/gen_trace_header.awk
+++ b/scripts/gen_trace_header.awk
@@ -1,28 +1,47 @@
BEGIN {
COUNT = split(" " SYMBOLS_LIST, SYMBOLS);
+
+ if (MODE == "gen") {
+ for (x in SYMBOLS) {
+ s = SYMBOLS[x]
+ print "SB_" s " = SYS_" s
+ }
+ exit(0);
+ }
}
+function out(name, val)
{
- if ($1 != "#define" || $2 !~ /^SYS_/)
+ name = toupper(name)
+ print "#define SB_SYS" syscall_prefix "_" name " " val;
+ print "S(" name ")";
+}
+
+{
+ # found: SB_func = #
+ # not found: SB_func = SYS_func
+ if ($1 !~ /^SB_/)
+ next;
+ if ($3 ~ /^SYS_/)
next;
- sub(/^SYS_/, "", $2);
+ sub(/^SB_/, "", $1);
for (i = 1; i <= COUNT; ++i)
- if (SYMBOLS[i] == $2) {
+ if (SYMBOLS[i] == $1) {
SYMBOLS[i] = "";
break;
}
- print "S(" $2 ")";
+ out($1, $3);
}
END {
- for (x in SYMBOLS) {
- s = SYMBOLS[x];
- if (s != "") {
- print "#define SYS_" s " SB_NR_UNDEF";
- print "S(" s ")";
+ if (MODE != "gen") {
+ for (x in SYMBOLS) {
+ s = SYMBOLS[x];
+ if (s != "")
+ out(s, "SB_NR_UNDEF");
}
}
}