+2006-12-20 Dmitry V. Levin <ldv@altlinux.org>
+
+ Show system call summary for each personality.
+ * syscall.c (countv): New call_counts pointers array.
+ (counts): Convert to macro wrapper around countv.
+ (call_summary_pers): New function.
+ (call_summary): Use it for each personality.
+ Fixes RH#192193.
+
2006-12-12 Dmitry V. Levin <ldv@altlinux.org>
Fix -ff -o behaviour. Fix piping trace output.
};;
int
-set_personality(personality)
-int personality;
+set_personality(int personality)
{
switch (personality) {
case 0:
int calls, errors;
};
-static struct call_counts *counts;
+static struct call_counts *countv[SUPPORTED_PERSONALITIES];
+#define counts (countv[current_personality])
static struct timeval shortest = { 1000000, 0 };
overhead.tv_usec = n % 1000000;
}
-void
-call_summary(outf)
-FILE *outf;
+static void
+call_summary_pers(FILE *outf)
{
int i, j;
int call_cum, error_cum;
call_cum, error_str, "total");
}
+
+void
+call_summary(FILE *outf)
+{
+ int i, old_pers = current_personality;
+
+ for (i = 0; i < SUPPORTED_PERSONALITIES; ++i)
+ {
+ if (!countv[i])
+ continue;
+
+ if (current_personality != i)
+ set_personality(i);
+ if (i)
+ fprintf(outf,
+ "System call usage summary for %u bit mode:\n",
+ personality_wordsize[current_personality] * 8);
+ call_summary_pers(outf);
+ }
+
+ if (old_pers != current_personality)
+ set_personality(old_pers);
+}