Project

General

Profile

Bug #3519

DTrace fails to resolve const types from fbt

Added by Christopher Siden over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Category:
DTrace
Start date:
2013-02-01
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Example:

# dtrace -n arc_read_nolock:entry -lv
   ID   PROVIDER            MODULE                          FUNCTION NAME
42150        fbt               zfs                   arc_read_nolock 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]: zio_t *
                args[1]: spa_t *
                args[2]: (unknown)
                args[3]: int (*)()
                args[4]: void *
                args[5]: int
                args[6]: int
                args[7]: uint32_t *
                args[8]: (unknown)
#1

Updated by Rich Lowe over 7 years ago

Is this one of the issues you guys have a fix for already?

#2

Updated by Christopher Siden over 7 years ago

  • Status changed from New to Pending RTI
  • % Done changed from 0 to 100

Yeah, I just sent a review to the list.

#3

Updated by Adam Leventhal over 7 years ago

Looking at the arc_read_nolock fuction, we can see that the types for which DTrace is struggling are the const ones:

2814int
2815arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp,
2816 arc_done_func_t *done, void *private, int priority, int zio_flags,
2817 uint32_t *arc_flags, const zbookmark_t *zb)

From the kernel, DTrace exposes types with a module qualifier:

  1. dtrace c 'dtrace -n arc_read:entry -lv' -n 'syscall::ioctl:entry/pid $target && arg1 1685352969/{ self>a = arg2; } syscall::ioctl:return/self->a/{ print(*(dtrace_argdesc_t *)copyin(self->a, sizeof (dtrace_argdesc_t))); self->a = 0; }'
    dtrace: description 'syscall::ioctl:entry' matched 2 probes
    ID PROVIDER MODULE FUNCTION NAME
    47431 fbt zfs arc_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
    args0: zio_t *
    args1: spa_t *
    args2: blkptr_t *
    args3: arc_done_func_t *
    args4: void *
    args5: int
    args6: int
    args7: uint32_t *
    args8: zbookmark_t *

dtrace: pid 237776 has exited
CPU ID FUNCTION:NAME
1 11564 ioctl:return dtrace_argdesc_t {
dtrace_id_t dtargd_id = 0xb947
int dtargd_ndx = 0
int dtargd_mapping = 0
char [128] dtargd_native = [ "zfs`zio_t *" ]
char [128] dtargd_xlate = [ "" ]
}
1 11564 ioctl:return dtrace_argdesc_t {
dtrace_id_t dtargd_id = 0xb947
int dtargd_ndx = 0x1
int dtargd_mapping = 0x1
char [128] dtargd_native = [ "zfs`spa_t *" ]
char [128] dtargd_xlate = [ "" ]
}
1 11564 ioctl:return dtrace_argdesc_t {
dtrace_id_t dtargd_id = 0xb947
int dtargd_ndx = 0x2
int dtargd_mapping = 0x2
char [128] dtargd_native = [ "const zfs`blkptr_t *" ]
char [128] dtargd_xlate = [ "" ]
}
1 11564 ioctl:return dtrace_argdesc_t {
dtrace_id_t dtargd_id = 0xb947
int dtargd_ndx = 0x3
int dtargd_mapping = 0x3
char [128] dtargd_native = [ "zfs`arc_done_func_t *" ]
char [128] dtargd_xlate = [ "" ]
}
1 11564 ioctl:return dtrace_argdesc_t {
dtrace_id_t dtargd_id = 0xb947
int dtargd_ndx = 0x4
int dtargd_mapping = 0x4
char [128] dtargd_native = [ "zfs`void *" ]
char [128] dtargd_xlate = [ "" ]
}
1 11564 ioctl:return dtrace_argdesc_t {
dtrace_id_t dtargd_id = 0xb947
int dtargd_ndx = 0x5
int dtargd_mapping = 0x5
char [128] dtargd_native = [ "zfs`int" ]
char [128] dtargd_xlate = [ "" ]
}
1 11564 ioctl:return dtrace_argdesc_t {
dtrace_id_t dtargd_id = 0xb947
int dtargd_ndx = 0x6
int dtargd_mapping = 0x6
char [128] dtargd_native = [ "zfs`int" ]
char [128] dtargd_xlate = [ "" ]
}
1 11564 ioctl:return dtrace_argdesc_t {
dtrace_id_t dtargd_id = 0xb947
int dtargd_ndx = 0x7
int dtargd_mapping = 0x7
char [128] dtargd_native = [ "zfs`uint32_t *" ]
char [128] dtargd_xlate = [ "" ]
}
1 11564 ioctl:return dtrace_argdesc_t {
dtrace_id_t dtargd_id = 0xb947
int dtargd_ndx = 0x8
int dtargd_mapping = 0x8
char [128] dtargd_native = [ "const zfs`zbookmark_t *" ]
char [128] dtargd_xlate = [ "" ]
}
1 11564 ioctl:return dtrace_argdesc_t {
dtrace_id_t dtargd_id = 0xb947
int dtargd_ndx = 0xffffffff
int dtargd_mapping = 0x9
char [128] dtargd_native = [ "" ]
char [128] dtargd_xlate = [ "" ]
}

"const zfs`bookmark_t *" for example is just as valid a type name as "zfs`bookmark_t"

#4

Updated by Christopher Siden over 7 years ago

  • Status changed from Pending RTI to Resolved
commit e98f46c
Author: Adam Leventhal <ahl@delphix.com>
Date:   Tue Feb 5 10:10:25 2013

    3519 DTrace fails to resolve const types from fbt
    3520 dtrace internal error -- token type 316 is not a valid D compilation token
    3521 clean up dtrace unit tests
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Eric Schrock <eric.schrock@delphix.com>
    Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
    Reviewed by: Christopher Siden <christopher.siden@delphix.com>
    Reviewed by: Richard Lowe <richlowe@richlowe.net>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF