g_journal_read has broken argument list in V10
Andreas Longwitz
longwitz at incore.de
Thu Aug 3 15:40:18 UTC 2017
> I use FreeBSD 10.3-STABLE r317936 with "old" /usr/lib/dtrace/ip.c and
> can't get DTrace to work for the function g_journal_read(). In the
> output of "dtrace -lv" I see
>
> 33379 fbt geom_journal g_journal_read entry
>
> Probe Description Attributes
> Identifier Names: Private
> Data Semantics: Private
> Dependency Class: Unknown
>
> Argument Attributes
> Identifier Names: Private
> Data Semantics: Private
> Dependency Class: ISA
>
> Argument Types
> args[0]: struct g_journal_softc *
> args[1]: off_t
> args[2]: off_t
> args[3]: struct bio *
>
> but the sourcefile g_journal.c gives
>
> static void
> g_journal_read(struct g_journal_softc *sc, struct bio *pbp, off_t
> ostart, off_t oend)
>
> So args[0] and args[2] matches in type, but args[1] and args[3] does
> not. This problem did not exist in FreeBSD V8, dtrace -lv gives correct
>
> 31519 fbt geom_journal g_journal_read entry
>
> Probe Description Attributes
> Identifier Names: Private
> Data Semantics: Private
> Dependency Class: Unknown
>
> Argument Attributes
> Identifier Names: Private
> Data Semantics: Private
> Dependency Class: ISA
>
> Argument Types
> args[0]: struct g_journal_softc *
> args[1]: struct bio *
> args[2]: off_t
> args[3]: off_t
>
> Please can somebody show me how this can be fixed ?
>
The output of ctfdump g_journal.o | grep g_journal_read is
[23] FUNC (g_journal_read) returns: 4 args: (1057, 381, 381, 955)
[24] FUNC (g_journal_read_done) returns: 4 args: (955)
with the type definitions
1057 struct g_journal_softc *
955 struct bio *
381 TYPEDEF off_t
Compiling g_journal.c with -O1 instead of the standard -O2 gives
[49] FUNC (g_journal_read) returns: 4 args: (1057, 955, 381, 381)
[50] FUNC (g_journal_read_done) returns: 4 args: (955)
[51] FUNC (g_journal_read_find) returns: 955 args: (955, 3, 955, 381, 381)
[52] FUNC (g_journal_read_first) returns: 4 args: (1057, 955)
[53] FUNC (g_journal_read_queue_find) returns: 955 args: (1082, 955,
381, 381)
and in this case the argument list for DTrace of g_journal_read is
correct. The number of args given by ctfdump seems to be broken in most
cases.
The function g_journal_read() is the only one in g_journal.c that shows
the described problem. I can not decide, if the object module
g_journal.o is broken or if ctfconvert does something wrong.
More information about the freebsd-dtrace
mailing list