Message ID | 20171206163804.26076-2-chris@chris-wilson.co.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 06/12/2017 16:38, Chris Wilson wrote: > When tracking down the cause of a particular kernel warning, knowing > which file it is associated with can be a big clue. So write the > filename into the kernel message log prior to opening it. > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > --- > tests/debugfs_test.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c > index 268d6e78f..2e87e4420 100644 > --- a/tests/debugfs_test.c > +++ b/tests/debugfs_test.c > @@ -61,8 +61,9 @@ static void read_and_discard_sysfs_entries(int path_fd, int indent) > int sub_fd; > ssize_t ret; > > - igt_set_timeout(5, "reading sysfs entry"); > + igt_kmsg(KMSG_DEBUG "Reading file \"%s\"\n", dirent->d_name); > igt_debug("%sReading file \"%s\"\n", tabs, dirent->d_name); > + igt_set_timeout(5, "reading sysfs entry"); > > sub_fd = openat(path_fd, dirent->d_name, O_RDONLY); > if (sub_fd == -1) { > If I may suggest an alternative - timestamp igt messages and write a log interleaver to be used with kernel log and igt log as inputs? That would avoid having to sprinkle igt_kmsg over igt code base as more interesting scenarios are discovered. Regards, Tvrtko
Quoting Tvrtko Ursulin (2017-12-06 16:51:24) > > On 06/12/2017 16:38, Chris Wilson wrote: > > When tracking down the cause of a particular kernel warning, knowing > > which file it is associated with can be a big clue. So write the > > filename into the kernel message log prior to opening it. > > > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > > --- > > tests/debugfs_test.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c > > index 268d6e78f..2e87e4420 100644 > > --- a/tests/debugfs_test.c > > +++ b/tests/debugfs_test.c > > @@ -61,8 +61,9 @@ static void read_and_discard_sysfs_entries(int path_fd, int indent) > > int sub_fd; > > ssize_t ret; > > > > - igt_set_timeout(5, "reading sysfs entry"); > > + igt_kmsg(KMSG_DEBUG "Reading file \"%s\"\n", dirent->d_name); > > igt_debug("%sReading file \"%s\"\n", tabs, dirent->d_name); > > + igt_set_timeout(5, "reading sysfs entry"); > > > > sub_fd = openat(path_fd, dirent->d_name, O_RDONLY); > > if (sub_fd == -1) { > > > > If I may suggest an alternative - timestamp igt messages and write a log > interleaver to be used with kernel log and igt log as inputs? How do you get igt_log over netconsole? -Chris
On 06/12/2017 17:02, Chris Wilson wrote: > Quoting Tvrtko Ursulin (2017-12-06 16:51:24) >> >> On 06/12/2017 16:38, Chris Wilson wrote: >>> When tracking down the cause of a particular kernel warning, knowing >>> which file it is associated with can be a big clue. So write the >>> filename into the kernel message log prior to opening it. >>> >>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> >>> --- >>> tests/debugfs_test.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c >>> index 268d6e78f..2e87e4420 100644 >>> --- a/tests/debugfs_test.c >>> +++ b/tests/debugfs_test.c >>> @@ -61,8 +61,9 @@ static void read_and_discard_sysfs_entries(int path_fd, int indent) >>> int sub_fd; >>> ssize_t ret; >>> >>> - igt_set_timeout(5, "reading sysfs entry"); >>> + igt_kmsg(KMSG_DEBUG "Reading file \"%s\"\n", dirent->d_name); >>> igt_debug("%sReading file \"%s\"\n", tabs, dirent->d_name); >>> + igt_set_timeout(5, "reading sysfs entry"); >>> >>> sub_fd = openat(path_fd, dirent->d_name, O_RDONLY); >>> if (sub_fd == -1) { >>> >> >> If I may suggest an alternative - timestamp igt messages and write a log >> interleaver to be used with kernel log and igt log as inputs? > > How do you get igt_log over netconsole? Hm, ok. But should we then just send igt logs to two places? Stdout/err and kmsg? Could be an environment option or something if required. Regards, Tvrtko
Quoting Tvrtko Ursulin (2017-12-06 17:04:40) > > On 06/12/2017 17:02, Chris Wilson wrote: > > Quoting Tvrtko Ursulin (2017-12-06 16:51:24) > >> > >> On 06/12/2017 16:38, Chris Wilson wrote: > >>> When tracking down the cause of a particular kernel warning, knowing > >>> which file it is associated with can be a big clue. So write the > >>> filename into the kernel message log prior to opening it. > >>> > >>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > >>> --- > >>> tests/debugfs_test.c | 3 ++- > >>> 1 file changed, 2 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c > >>> index 268d6e78f..2e87e4420 100644 > >>> --- a/tests/debugfs_test.c > >>> +++ b/tests/debugfs_test.c > >>> @@ -61,8 +61,9 @@ static void read_and_discard_sysfs_entries(int path_fd, int indent) > >>> int sub_fd; > >>> ssize_t ret; > >>> > >>> - igt_set_timeout(5, "reading sysfs entry"); > >>> + igt_kmsg(KMSG_DEBUG "Reading file \"%s\"\n", dirent->d_name); > >>> igt_debug("%sReading file \"%s\"\n", tabs, dirent->d_name); > >>> + igt_set_timeout(5, "reading sysfs entry"); > >>> > >>> sub_fd = openat(path_fd, dirent->d_name, O_RDONLY); > >>> if (sub_fd == -1) { > >>> > >> > >> If I may suggest an alternative - timestamp igt messages and write a log > >> interleaver to be used with kernel log and igt log as inputs? > > > > How do you get igt_log over netconsole? > > Hm, ok. But should we then just send igt logs to two places? Stdout/err > and kmsg? Could be an environment option or something if required. There are quite a few igt logs that would be nice in the kernel log, pretty much anything info+. Maybe debug+ if we push some of the noise out of debug and down into even lower-priority-debug. -Chris
On Wed, 2017-12-06 at 17:02 +0000, Chris Wilson wrote: > Quoting Tvrtko Ursulin (2017-12-06 16:51:24) > > > > If I may suggest an alternative - timestamp igt messages and write a log > > interleaver to be used with kernel log and igt log as inputs? > > How do you get igt_log over netconsole? With igt-runner? If the idea wasn't rejected :P Regards, Joonas
Quoting Joonas Lahtinen (2017-12-11 11:02:27) > On Wed, 2017-12-06 at 17:02 +0000, Chris Wilson wrote: > > Quoting Tvrtko Ursulin (2017-12-06 16:51:24) > > > > > > If I may suggest an alternative - timestamp igt messages and write a log > > > interleaver to be used with kernel log and igt log as inputs? > > > > How do you get igt_log over netconsole? > > With igt-runner? If the idea wasn't rejected :P Speaking of igt-runner, tools/testing/selftests/rcutorture/doc/initrd.txt tl;dr: use dracut Also on my current agenda is diving into syzkaller. -Chris
diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c index 268d6e78f..2e87e4420 100644 --- a/tests/debugfs_test.c +++ b/tests/debugfs_test.c @@ -61,8 +61,9 @@ static void read_and_discard_sysfs_entries(int path_fd, int indent) int sub_fd; ssize_t ret; - igt_set_timeout(5, "reading sysfs entry"); + igt_kmsg(KMSG_DEBUG "Reading file \"%s\"\n", dirent->d_name); igt_debug("%sReading file \"%s\"\n", tabs, dirent->d_name); + igt_set_timeout(5, "reading sysfs entry"); sub_fd = openat(path_fd, dirent->d_name, O_RDONLY); if (sub_fd == -1) {
When tracking down the cause of a particular kernel warning, knowing which file it is associated with can be a big clue. So write the filename into the kernel message log prior to opening it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> --- tests/debugfs_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)