From owner-freebsd-dtrace@freebsd.org Thu Aug 3 15:40:18 2017 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 505DEDC4595 for ; Thu, 3 Aug 2017 15:40:18 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB170834D8 for ; Thu, 3 Aug 2017 15:40:17 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by dss.incore.de (Postfix) with ESMTP id 9557C6D453 for ; Thu, 3 Aug 2017 17:40:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at incore.de Received: from dss.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id iBNS6GuEXPPA for ; Thu, 3 Aug 2017 17:40:08 +0200 (CEST) Received: from mail.local.incore (fwintern.dmz [10.0.0.253]) by dss.incore.de (Postfix) with ESMTP id 823E06D1EB for ; Thu, 3 Aug 2017 17:40:08 +0200 (CEST) Received: from bsdlo.incore (bsdlo.incore [192.168.0.84]) by mail.local.incore (Postfix) with ESMTP id 6F897508A2 for ; Thu, 3 Aug 2017 17:40:08 +0200 (CEST) Message-ID: <598343D8.8060101@incore.de> Date: Thu, 03 Aug 2017 17:40:08 +0200 From: Andreas Longwitz User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: "freebsd-dtrace@freebsd.org" Subject: Re: g_journal_read has broken argument list in V10 References: <596F2CDA.1000705@incore.de> In-Reply-To: <596F2CDA.1000705@incore.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 15:40:18 -0000 > 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. From owner-freebsd-dtrace@freebsd.org Thu Aug 3 17:09:32 2017 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECE63DC891F for ; Thu, 3 Aug 2017 17:09:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x232.google.com (mail-qt0-x232.google.com [IPv6:2607:f8b0:400d:c0d::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98AF7278B for ; Thu, 3 Aug 2017 17:09:32 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x232.google.com with SMTP id a18so11419050qta.0 for ; Thu, 03 Aug 2017 10:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=M10JewIw9Ed7mgrI87/3/ATwrYik9gLPJVAU3t4QBqc=; b=aTniY/ZXqYBLtOMlYficp5kNsE4rw9ckC+aN8+9cRa+PufVf43AnMqlCFdEGCwRLwh sZUyTXGGKJIJ3Q29o5rjd9hKr8YAuOkthsaxxcqls0YYOkMIXc6SNFDtcZcX3GSj7C9X fELmPRBRFUJHD+9agwd43IiEkBh40XrH58xKtWXNuOUhV7SUm95CXfEz1jzDg/nUZwOx 1ViS6q6eoDJNcv6oa97Xo9nSigE8CxSJCPTHjAEJLskc0BvjK4V44GRxgsI5oDVTWr/f 4dAUslwqkiGlFrC3uHjmhS1RpeJv4Em0TE6Aj3dBOwtj4bDJaU2gp0fA9mFr4OqU9C9y DKeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=M10JewIw9Ed7mgrI87/3/ATwrYik9gLPJVAU3t4QBqc=; b=JAj7WHEQFwBM2MoSM6WGL7M3nuSWHMgL8JN12wU9WF58qJMO57cy8a+VgxOgaDD5dV YXXXIWztC/txMALHBNjJQ+bdnpcI4SdAiV9Qv5ChTllqwVmrk77bwxb22ykSg7tt188b dKbeGXQ9gQOKzEPL3ilbfZ2y0pxeP67umXghVkjPlIkHQt+J2zawi/G/g2aFx6jMVUe/ Mt3USuXmhBIEiVgIu67JlSspOjYPaufdb4PorpwYSGs7p/DDrSJ1TWInrLKM/hWMe/qS HE2tNEVywQ8zeThDSh4/GuN07IFvgleL3WYSyX/Ur+WCebb6HW2KP6SpULMgB/UfnLRN OKDQ== X-Gm-Message-State: AIVw110KCsIoSYT4oOUYMkGxxE1OS83o4shFG3ElxC4/FDkcT6oF/8Vp CFkA6Dc57XiCWDCg X-Received: by 10.200.52.212 with SMTP id x20mr3304117qtb.53.1501780171366; Thu, 03 Aug 2017 10:09:31 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id f20sm25678752qke.55.2017.08.03.10.09.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2017 10:09:30 -0700 (PDT) Sender: Mark Johnston Date: Thu, 3 Aug 2017 10:10:11 -0700 From: Mark Johnston To: Andreas Longwitz Cc: "freebsd-dtrace@freebsd.org" Subject: Re: g_journal_read has broken argument list in V10 Message-ID: <20170803171011.GB4968@wkstn-mjohnston.west.isilon.com> References: <596F2CDA.1000705@incore.de> <598343D8.8060101@incore.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <598343D8.8060101@incore.de> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 17:09:33 -0000 On Thu, Aug 03, 2017 at 05:40:08PM +0200, Andreas Longwitz wrote: > > 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. It's possible that the compiler is reordering arguments. CTF is generated from DWARF info, so the way to determine if this is the case is to inspect the dwarf tags with dwarfdump or readelf -w and check the parameter order there. I don't know why the arguments would be getting reordered in this case, but I've seen it happen before, particularly in functions that take struct values as parameters. Specifically, on amd64 such parameters are moved to the end of the list so other parameters may be passed in registers. FWIW, with clang 5.0 on ~CURRENT I get the expected parameter order: [23] FUNC (g_journal_read) returns: 1 args: (1090, 988, 332, 332) From owner-freebsd-dtrace@freebsd.org Fri Aug 4 10:46:24 2017 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CE6ADD29CA for ; Fri, 4 Aug 2017 10:46:24 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD9C63F4E; Fri, 4 Aug 2017 10:46:23 +0000 (UTC) (envelope-from longwitz@incore.de) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by dss.incore.de (Postfix) with ESMTP id DEDC267998; Fri, 4 Aug 2017 12:46:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at incore.de Received: from dss.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id etuQfI4PTqbs; Fri, 4 Aug 2017 12:46:19 +0200 (CEST) Received: from mail.local.incore (fwintern.dmz [10.0.0.253]) by dss.incore.de (Postfix) with ESMTP id 7D208679B3; Fri, 4 Aug 2017 12:46:18 +0200 (CEST) Received: from bsdlo.incore (bsdlo.incore [192.168.0.84]) by mail.local.incore (Postfix) with ESMTP id 53D9D508A1; Fri, 4 Aug 2017 12:46:18 +0200 (CEST) Message-ID: <5984507A.3090104@incore.de> Date: Fri, 04 Aug 2017 12:46:18 +0200 From: Andreas Longwitz User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: Mark Johnston CC: "freebsd-dtrace@freebsd.org" Subject: Re: g_journal_read has broken argument list in V10 References: <596F2CDA.1000705@incore.de> <598343D8.8060101@incore.de> <20170803171011.GB4968@wkstn-mjohnston.west.isilon.com> In-Reply-To: <20170803171011.GB4968@wkstn-mjohnston.west.isilon.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 10:46:24 -0000 Hello, thanks for answer. >> >> 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. > > It's possible that the compiler is reordering arguments. CTF is > generated from DWARF info, so the way to determine if this is the case > is to inspect the dwarf tags with dwarfdump or readelf -w and check the > parameter order there. I don't know why the arguments would be getting > reordered in this case, but I've seen it happen before, particularly in > functions that take struct values as parameters. Specifically, on amd64 > such parameters are moved to the end of the list so other parameters may > be passed in registers. > > FWIW, with clang 5.0 on ~CURRENT I get the expected parameter order: > > [23] FUNC (g_journal_read) returns: 1 args: (1090, 988, 332, 332) Yes, dwarfdump shows the problem is in g_journal.o, the list of formal parameters is reordered by the compiler: < 1><0x0000cb4f> DW_TAG_subprogram DW_AT_name g_journal_read DW_AT_decl_file 0x00000001 /usr/src/sys/geom/journal/g_journal.c DW_AT_decl_line 0x0000061f DW_AT_prototyped yes(1) DW_AT_low_pc 0x00008ad0 DW_AT_high_pc 0x0000915c DW_AT_frame_base DW_OP_reg6 < 2><0x0000cb6a> DW_TAG_formal_parameter DW_AT_name sc DW_AT_decl_file 0x00000001 /usr/src/sys/geom/journal/g_journal.c DW_AT_decl_line 0x0000061f DW_AT_type <0x0000949a> DW_AT_location [ 0]< offset pair low-off : 0x00008ad0 addr 0x00008ad0 high-off 0x00008b35 addr 0x00008b35>DW_OP_reg5 [ 1]< offset pair low-off : 0x00008b35 addr 0x00008b35 high-off 0x00008b35 addr 0x00008b35>DW_OP_breg6-104 < 2><0x0000cb7a> DW_TAG_formal_parameter DW_AT_name ostart DW_AT_decl_file 0x00000001 /usr/src/sys/geom/journal/g_journal.c DW_AT_decl_line 0x0000061f DW_AT_type <0x00003b31> DW_AT_location [ 0]< offset pair low-off : 0x00008ad0 addr 0x00008ad0 high-off 0x00008bb8 addr 0x00008bb8>DW_OP_reg14 < 2><0x0000cb8a> DW_TAG_formal_parameter DW_AT_name oend DW_AT_decl_file 0x00000001 /usr/src/sys/geom/journal/g_journal.c DW_AT_decl_line 0x00000620 DW_AT_type <0x00003b31> DW_AT_location [ 0]< offset pair low-off : 0x00008ad0 addr 0x00008ad0 high-off 0x00008b35 addr 0x00008b35>DW_OP_reg2 < 2><0x0000cb9a> DW_TAG_formal_parameter DW_AT_name pbp DW_AT_decl_file 0x00000001 /usr/src/sys/geom/journal/g_journal.c DW_AT_decl_line 0x0000061f DW_AT_type <0x00005de4> By the way, the following patch solves the problem with the wrong argument counts in ctfdump: --- dump.c.1st 2015-07-03 16:39:24.000000000 +0200 +++ dump.c 2017-08-04 10:56:21.563805000 +0200 @@ -364,7 +364,8 @@ (void) printf(" [%lu] FUNC ", id); if (name != NULL) (void) printf("(%s) ", name); - (void) printf("returns: %u args: (", *fp++); + (void) printf("returns: %u args: (", n); + fp++; if (n != 0) { (void) printf("%u", *fp++); -- Andreas Longwitz From owner-freebsd-dtrace@freebsd.org Fri Aug 4 17:42:21 2017 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E71E5DC05FC for ; Fri, 4 Aug 2017 17:42:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CF2671101 for ; Fri, 4 Aug 2017 17:42:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x22a.google.com with SMTP id v29so13019100qtv.3 for ; Fri, 04 Aug 2017 10:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FAoM3DI1lSPSMcdA9FoX4Jr7utPLCZHmN6YeQx3zrRQ=; b=RqHatPBnyJ+0C0cEKhEXZ8Dp1+oke7jEGy+IQZbUiPCnOHhHvJHujnt4PovYMqvDf1 LGsSQGk0gKks+dbTWxcTPQtFHWOwFQ4VsA3OVAOpd82z1eMyyQA2l7NtB+7CMtJIPpmI XcDni/c60nlXmUFUVQvbj+3QFIXDWg8k76utGO1XHN2ajCxL9MPfKPbq8Wl8m2V5Y8/c WLiOjQvSPQP81Z6zrgiw/go0bGlG6GWG3xI9Zh73x1l7q63eRjNLEhBsDPqnApPvBCZx Ciw19lB3mvfFohyyJ7iljMMojod6+m2hkN2Bh6zNYnaEO7tIoB68hI9S6NyLl7zxg6Mr JdtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=FAoM3DI1lSPSMcdA9FoX4Jr7utPLCZHmN6YeQx3zrRQ=; b=p3JgB7Z1d3Xn9ND5IYQXEMxwd9ZsmEc39ORJhoWe4t4eZP3hR6i+fWNGGhkLPQof8E gdgqmpt5zvMvsUW0LXbt45tg3PW9iYpCoduvV4bPpxjadZXYhm7LJAiHcosnzAGSfw0H l7BEDhs4CKGMPCPJy2soU8DjlvfLfjlqSRbgfICqnxv1Jd2P3mZ9Xlv6VQXWGXCjng6B sxSBVwe0jajCFUd2mTfDMH9HdKHT1YzT2eRFczkrDYOH9bls5P/C+ubAjCHs5GFOgEhC XYE0ilzc45FC1tEtISZphuFq/W2oL3DyZJZwpchws/FW7G7Xqq4IDXupM+4/54P6nuzb keLg== X-Gm-Message-State: AHYfb5gLMJjabSk8TF6OTH2J4ZT8wdEOvrBOOvjPnYywRl6NHGsJriRO zSx3P+ylE/ULs7dV X-Received: by 10.237.34.194 with SMTP id q2mr4729015qtc.255.1501868540664; Fri, 04 Aug 2017 10:42:20 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id l47sm1477235qtc.64.2017.08.04.10.42.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Aug 2017 10:42:20 -0700 (PDT) Sender: Mark Johnston Date: Fri, 4 Aug 2017 10:43:24 -0700 From: Mark Johnston To: Andreas Longwitz Cc: "freebsd-dtrace@freebsd.org" Subject: Re: g_journal_read has broken argument list in V10 Message-ID: <20170804174324.GA66372@wkstn-mjohnston.west.isilon.com> References: <596F2CDA.1000705@incore.de> <598343D8.8060101@incore.de> <20170803171011.GB4968@wkstn-mjohnston.west.isilon.com> <5984507A.3090104@incore.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5984507A.3090104@incore.de> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2017 17:42:22 -0000 On Fri, Aug 04, 2017 at 12:46:18PM +0200, Andreas Longwitz wrote: > By the way, the following patch solves the problem with the wrong > argument counts in ctfdump: I think the existing code is correct. It's printing the CTF type index of the return type, not the number of arguments. In particular, we have: <1> INTEGER void encoding=SIGNED offset=0 bits=0 so "returns 1" just means that the return type is void. > > --- dump.c.1st 2015-07-03 16:39:24.000000000 +0200 > +++ dump.c 2017-08-04 10:56:21.563805000 +0200 > @@ -364,7 +364,8 @@ > (void) printf(" [%lu] FUNC ", id); > if (name != NULL) > (void) printf("(%s) ", name); > - (void) printf("returns: %u args: (", *fp++); > + (void) printf("returns: %u args: (", n); > + fp++; > > if (n != 0) { > (void) printf("%u", *fp++);