mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-11 18:06:13 +00:00
core: Inject program name into dmesg
Write the program name if !list_only so that we associate oops with simple tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
e0dffbdeda
commit
b9e7637542
@ -218,6 +218,24 @@ int num_test_children;
|
|||||||
int test_children_sz;
|
int test_children_sz;
|
||||||
bool test_child;
|
bool test_child;
|
||||||
|
|
||||||
|
__attribute__((format(printf, 1, 2)))
|
||||||
|
static void kmsg(const char *format, ...)
|
||||||
|
#define KERN_INFO "<5>"
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
FILE *file;
|
||||||
|
|
||||||
|
file = fopen("/dev/kmsg", "w");
|
||||||
|
if (file == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
va_start(ap, format);
|
||||||
|
vfprintf(file, format, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
fclose(file);
|
||||||
|
}
|
||||||
|
|
||||||
bool __igt_fixture(void)
|
bool __igt_fixture(void)
|
||||||
{
|
{
|
||||||
assert(!in_fixture);
|
assert(!in_fixture);
|
||||||
@ -378,8 +396,6 @@ static int common_init(int argc, char **argv,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
oom_adjust_for_doom();
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
free(short_opts);
|
free(short_opts);
|
||||||
free(combined_opts);
|
free(combined_opts);
|
||||||
@ -399,7 +415,12 @@ out:
|
|||||||
/* exit with no error for -h/--help */
|
/* exit with no error for -h/--help */
|
||||||
exit(ret == -1 ? 0 : IGT_EXIT_INVALID);
|
exit(ret == -1 ? 0 : IGT_EXIT_INVALID);
|
||||||
|
|
||||||
print_version();
|
if (!list_subtests) {
|
||||||
|
kmsg(KERN_INFO "%s: executing\n", command_str);
|
||||||
|
print_version();
|
||||||
|
|
||||||
|
oom_adjust_for_doom();
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -498,24 +519,6 @@ void igt_simple_init_parse_opts(int argc, char **argv,
|
|||||||
extra_opt_handler);
|
extra_opt_handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((format(printf, 1, 2)))
|
|
||||||
static void kmsg(const char *format, ...)
|
|
||||||
#define KERN_INFO "<5>"
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
FILE *file;
|
|
||||||
|
|
||||||
file = fopen("/dev/kmsg", "w");
|
|
||||||
if (file == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
va_start(ap, format);
|
|
||||||
vfprintf(file, format, ap);
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
fclose(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: Testcases which use these helpers MUST NOT output anything to stdout
|
* Note: Testcases which use these helpers MUST NOT output anything to stdout
|
||||||
* outside of places protected by igt_run_subtest checks - the piglit
|
* outside of places protected by igt_run_subtest checks - the piglit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user