[DTrace-devel] [PATCH] test: skip tst.symbols.c if no /proc/kallmodsyms
Eugene Loh
eugene.loh at oracle.com
Thu Aug 1 00:50:36 UTC 2024
On 7/31/24 15:55, Kris Van Hees wrote:
> On Wed, Jul 31, 2024 at 03:36:49PM -0400, Eugene Loh wrote:
>> Should we be adding a version of the test that's appropriate for
>> /proc/kallsyms?
> I don't think that would make sense because this test seems to validate the
> kallmodsyms information against the information dtrace is able to determine.
> But with kallsyms and modules.builtin.ranges, we don't really have a good
> way to validate the module association because there is only one source for
> it.
>
> I guess we could implement a version of this test that merely checks that
> the symbol-address association is accurate but that is possibly not even
> really worth doing? We obtain it using a straight read from the file and
> adding the name and address to a list. Validation would merely mean that
> we validate that we read it correctly and stored it correctly.
Already the test checks admittedly little, but little tests do catch
errors. Anyhow,
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
>> On 7/31/24 15:02, Kris Van Hees wrote:
>>> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
>>> ---
>>> test/unittest/consumer/tst.symbols.x | 12 ++++++++++++
>>> 1 file changed, 12 insertions(+)
>>> create mode 100755 test/unittest/consumer/tst.symbols.x
>>>
>>> diff --git a/test/unittest/consumer/tst.symbols.x b/test/unittest/consumer/tst.symbols.x
>>> new file mode 100755
>>> index 00000000..e83d97f6
>>> --- /dev/null
>>> +++ b/test/unittest/consumer/tst.symbols.x
>>> @@ -0,0 +1,12 @@
>>> +#!/bin/bash
>>> +#
>>> +# Oracle Linux DTrace.
>>> +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
>>> +# Licensed under the Universal Permissive License v 1.0 as shown at
>>> +# http://oss.oracle.com/licenses/upl.
>>> +
>>> +# If /proc/kallmodsyms does not exist, there is nothing to test
>>> +
>>> +[[ -r /proc/kallmodsyms ]] || exit 2
>>> +
>>> +exit 0
More information about the DTrace-devel
mailing list