From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44709 invoked by alias); 7 Feb 2020 10:11:27 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 44700 invoked by uid 89); 7 Feb 2020 10:11:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=Friday, systemtap@sourceware.org, sk:systemt, U*systemtap X-HELO: esa15.fujitsucc.c3s2.iphmx.com Received: from esa15.fujitsucc.c3s2.iphmx.com (HELO esa15.fujitsucc.c3s2.iphmx.com) (68.232.156.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Feb 2020 10:11:25 +0000 IronPort-SDR: RCUxbGO3q6Ad/94wCQwEE4ZUeLEhbmQQ4vu9K5M/TZ+HReQxxdons2iam1kDy/ikXYC8B016fT sQ7jY8ubkTFxJc8eFrpf445u2AJES/0+iGq9pm6w211uBBUf2KsPLcgRTxBRzckW76UgT8CWeL LRKxZZ/U4rT7l12NgEM/BoEUCFeH3rjrTf04ByG9g3hd6/hhYM6m6dJVCge7+yzgNzQ8JSdUaF y7I99mp9s6QgLLUNXMzVgHe2pFTt/NwXa4/3N/MGg4upPl0xZ8jJM8NvkQA7MP/CgCgqyUbYgZ CeY= Received: from mail-ty1jpn01lp2058.outbound.protection.outlook.com (HELO JPN01-TY1-obe.outbound.protection.outlook.com) ([104.47.93.58]) by ob1.fujitsucc.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2020 19:11:22 +0900 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OOc0gSbJOWmLlvyYa+Z87DwE+GLNweyrQZpzKmHzlmxdYiYUSQEzBPIe//Icc8MQADUqY8Dy6B4A7p9PWf1+i0sFaefWMmG4Q1W4NgREM+yW0hZuYG63FJ4XTcUE+i+tGecogTbtqusRmh4wW0jX8uVXm1XyCSC9Kd6K2FLFw8oLI2QaTrOxeSHdeKOkQePAMIrpFRD1RUbjkhlR73MpB39CLrDOZ9voUE2cAbTxBVXvxO1sczdN1QvwYtVzMmfGY7G7uGpuneCcc42xtjpBVO5TgiLO9FQlnn5RaW36qLf7IVobR2ta+pB1RHF7uiLKsiZuhkRM7Cv9y6pPPVRh4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eET/QItAYrsRst6Emp96zBqhAra8eWHDvk0wkQrngrI=; b=Cqy8g7mS48RwKFrrxDY6dcU4Ckis/s1UOnukBVojlxBCFmh7L97u36af0F6enOffWpSMHsbc0o2lKtRonI3dAp+3ZI72BnEC8WAPdrZOOIoY/LCwQ7pAUFsTIURayLeZuUQp7tsM25jgc5t5K5I8YlNuemcm8qLbVBvc8IauTe/mkIryeByxHuZOGiI1WrOi6DJcZzUthDweTXkoYcw5TvX/yHgbQEb93N63s7uzC4rfGkmEP9jdbEdg001VKh37Ambw9w/Tl1yE8wPmFJhrlI4D8ytgoSFpizyswMzok/dpC2C29ZSIqhUWego9cboUaUsT3nRFSvHShFiAs4TMUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fujitsu.com; dmarc=pass action=none header.from=fujitsu.com; dkim=pass header.d=fujitsu.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.onmicrosoft.com; s=selector2-fujitsu-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eET/QItAYrsRst6Emp96zBqhAra8eWHDvk0wkQrngrI=; b=WLI3QtGKgdMRA5CsP3Nun8uLhqTEX95j1AmsUtwDD4peNkJEiMkNi4MVJgwb1fgQNrDy1FAisHv3Bl+x2GY4G6pN/uk59wZxI95UuguyKlUO+Nwlysq2l0f075+BUewDRjgDMK6JHrcZTRkkIG55tRXv6yVAx9LBWh8R4CgJTXU= Received: from OSBPR01MB4006.jpnprd01.prod.outlook.com (20.178.98.151) by OSBPR01MB2423.jpnprd01.prod.outlook.com (52.134.253.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.24; Fri, 7 Feb 2020 10:11:19 +0000 Received: from OSBPR01MB4006.jpnprd01.prod.outlook.com ([fe80::1c51:734d:bcc3:8626]) by OSBPR01MB4006.jpnprd01.prod.outlook.com ([fe80::1c51:734d:bcc3:8626%5]) with mapi id 15.20.2707.020; Fri, 7 Feb 2020 10:11:19 +0000 From: "d.hatayama@fujitsu.com" To: 'Mark Wielaard' CC: "'systemtap@sourceware.org'" Subject: RE: [PATCH] loc2c-runtime: fix compilation failure Date: Fri, 07 Feb 2020 10:11:00 -0000 Message-ID: References: <20200207095115.GM42691@wildebeest.org> In-Reply-To: <20200207095115.GM42691@wildebeest.org> authentication-results: spf=none (sender IP is ) smtp.mailfrom=d.hatayama@fujitsu.com; x-ms-oob-tlc-oobclassifiers: OLM:901; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-messagedata: wkktOs+NKO+V1C5ov2W0iCRdn6uc9JlrZHcr1FaeDfH6O+IYkF2AaQXxrLmKYkeCi8RG0BuS0O6oWQT1Cg5MmtlPXhgYHXl5ix2EJN7Rre6mjUt9k/oz4Rriyue0MMg/B97Alt8S2awimN5HFm6sJw== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9WDce51xMhFqseA/J1L3q9tbe24tTCe5dKBGnrQ9Bl+qMHQgWBJy8vKXhuSExi/HGzNIAPo/Av1sUDmtS6FgC20OEYnTVzIjuEhiDsy8XK0= X-SW-Source: 2020-q1/txt/msg00013.txt > -----Original Message----- > From: Mark Wielaard > Sent: Friday, February 7, 2020 6:51 PM > To: Hatayama, Daisuke/=1B$BH*;3=1B(B =1B$BBgJe=1B(B > Cc: 'systemtap@sourceware.org' > Subject: Re: [PATCH] loc2c-runtime: fix compilation failure >=20 > Hi, >=20 > On Fri, Feb 07, 2020 at 04:07:21AM +0000, d.hatayama@fujitsu.com wrote: > > I ran into the following compilation failure when I tried to change > > $return in a return probe for some user-space process: > > [...] > > This failure is caused by a typo of the name of an argument variable > > of macro u_store_register introduced at the commit > > a03b455bc656216a4829dbad08e630949d944c75. > > --- > > runtime/linux/loc2c-runtime.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/runtime/linux/loc2c-runtime.h b/runtime/linux/loc2c-runtim= e.h > > index b4a329b..0270fa1 100644 > > --- a/runtime/linux/loc2c-runtime.h > > +++ b/runtime/linux/loc2c-runtime.h > > @@ -294,7 +294,7 @@ static void ursl_store64 (const struct usr_regset_l= ut* lut,unsigned lutsize, in > > #define uu_store_register(_regs,regno,value) (_stp_is_compat_task() ?= ursl_store32(url_i386, > ARRAY_SIZE(url_i386), EM_386, regno, value) : ursl_store64(url_x86_64, AR= RAY_SIZE(url_x86_64), EM_X86_64, regno, > value)) > > > > #define u_fetch_register(regno) > check_fetch_register(c->uregs,regno,_stp_is_compat_task()?ARRAY_SIZE(url_= i386):ARRAY_SIZE(url_x86_64),uu_fetc > h_register) > > -#define u_store_register(regno,value) > check_store_register(c->uregs,regnoo,_stp_is_compat_task()?ARRAY_SIZE(url= _i386):ARRAY_SIZE(url_x86_64),value,u > u_store_register) > > +#define u_store_register(regno,value) > check_store_register(c->uregs,regno,_stp_is_compat_task()?ARRAY_SIZE(url_= i386):ARRAY_SIZE(url_x86_64),value,u > u_store_register) > > > > #endif >=20 > This looks completely correct. The typo is pretty clear in the > original commit. I am just surprised we haven't seen this issue > before since the commit was pushed almost a year ago. What was the > exact script that showed this issue? We should probably add it as a > testcase together with the fix. >=20 It's enough to reproduce the issue as follows on my system: # cat ./repro.c static int f(void) { return 0; } int main() { f(); } # gcc -g -O0 ./repro.c -o repro # stap -v -g -e 'probe process("./repro").function("f").return {$return =3D= 1}' -c ./repro Pass 1: parsed user script and 478 library scripts using 238948virt/80996re= s/12320shr/68280data kb, in 750usr/240sys/1001real ms. Pass 2: analyzed script: 1 probe, 1 function, 0 embeds, 0 globals using 240= 532virt/83832res/13444shr/69864data kb, in 20usr/10sys/48real ms. Pass 3: translated to C into "/tmp/stapDh6s0j/stap_300c9b53758795cc27758f1e= aadbf6bd_1183_src.c" using 240664virt/84332res/13696shr/69996data kb, in 17= 0usr/290sys/474real ms. In file included from /usr/share/systemtap/runtime/linux/runtime.h:217, from /usr/share/systemtap/runtime/runtime.h:26, from /tmp/stapDh6s0j/stap_300c9b53758795cc27758f1eaadbf6bd= _1183_src.c:26: /tmp/stapDh6s0j/stap_300c9b53758795cc27758f1eaadbf6bd_1183_src.c: In functi= on =1B$B!F=1B(Bfunction___private__input___dwarf_tvar_set_return_0=1B$B!G= =1B(B: /usr/share/systemtap/runtime/linux/loc2c-runtime.h:297:69: error: =1B$B!F= =1B(Bregnoo=1B$B!G=1B(B undeclared (first use in this function); did you me= an =1B$B!F=1B(Brep_nop=1B$B!G=1B(B? #define u_store_register(regno,value) check_store_register(c->uregs,regnoo= ,_stp_is_compat_task()?ARRAY_SIZE(url_i386):ARRAY_SIZE(url_x86_64),value,uu= _store_register) ^~~~~~ /usr/share/systemtap/runtime/linux/loc2c-runtime.h:44:23: note: in definiti= on of macro =1B$B!F=1B(Bcheck_store_register=1B$B!G=1B(B if ((regs) =3D=3D 0 || (regno) < 0 || (regno) > (maxregno)) { \ ^~~~~ /tmp/stapDh6s0j/stap_300c9b53758795cc27758f1eaadbf6bd_1183_src.c:182:3: not= e: in expansion of macro =1B$B!F=1B(Bu_store_register=1B$B!G=1B(B u_store_register(0, l->__tmp0); ^~~~~~~~~~~~~~~~ /usr/share/systemtap/runtime/linux/loc2c-runtime.h:297:69: note: each undec= lared identifier is reported only once for each function it appears in #define u_store_register(regno,value) check_store_register(c->uregs,regnoo= ,_stp_is_compat_task()?ARRAY_SIZE(url_i386):ARRAY_SIZE(url_x86_64),value,uu= _store_register) ^~~~~~ /usr/share/systemtap/runtime/linux/loc2c-runtime.h:44:23: note: in definiti= on of macro =1B$B!F=1B(Bcheck_store_register=1B$B!G=1B(B if ((regs) =3D=3D 0 || (regno) < 0 || (regno) > (maxregno)) { \ ^~~~~ /tmp/stapDh6s0j/stap_300c9b53758795cc27758f1eaadbf6bd_1183_src.c:182:3: not= e: in expansion of macro =1B$B!F=1B(Bu_store_register=1B$B!G=1B(B u_store_register(0, l->__tmp0); ^~~~~~~~~~~~~~~~ make[1]: *** [scripts/Makefile.build:312: /tmp/stapDh6s0j/stap_300c9b537587= 95cc27758f1eaadbf6bd_1183_src.o] Error 1 make: *** [Makefile:1544: _module_/tmp/stapDh6s0j] Error 2 WARNING: kbuild exited with status: 2 Pass 4: compiled C into "stap_300c9b53758795cc27758f1eaadbf6bd_1183.ko" in = 45630usr/15450sys/62241real ms. Pass 4: compilation failed. [man error::pass4] Thanks. HATAYAMA, Daisuke