Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1321623imc; Mon, 11 Mar 2019 11:06:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrtNUXl7Wl10cUQ1PNfl6hbDnmki9/6qW+8Wk+5HHYh85a0HyC6RWA5sLZlIlElde8qE6a X-Received: by 2002:a17:902:2888:: with SMTP id f8mr35603185plb.244.1552327573539; Mon, 11 Mar 2019 11:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552327573; cv=none; d=google.com; s=arc-20160816; b=HCTTgSOcw+djWDZt1FP8ZvGwTsFAMGzk3B0UWZ1mYZyiek9FLON2pWnvsTwzxhV7GM KIsbUCPmkeP7wPSBpYXGwn0iWEGXtUrQhP2YZ4fXcjJl0+WzUYWIVruGQfa6Nyct3D4O uyvcSNDdLo2QrSk4qeDniI+dbI+BSBEFTdZCMM0SvE+RicuQbC1mGnT4jn7bdY7d99sI 1LyBnjh4bc2XyfHwosxWDlwv+z4T33oR0jqGDXrtmQr6co9RNS+9/TjaIqqmGhui+zoZ abwjUK9fGxnBsVJc82IcoezOUP6S1nBshTwjClw28Eq5+4zj4jaf1HIdqla4UnRbNKLY syAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:dkim-signature; bh=RLwKrC/voF+3rND48JyAOGO3PFc84l3SvAWoXb5wgrY=; b=WMDcOJrxOh4UzqBQSiIf+LN/sI4vi50gdrZevr0XaRqyn/8Yl5KcCR/XcETa5ciPBD +R3GL7nlkkal+D3V9En6HZfUtzJutRNNqhoN2xiix+jglintRqCVq8Q1vPXmagg4TEGo XYS2a7WVCA+wdzfn+l8U/0JIFRPcIaHCUHF6/zL4bHisPl3q62IUwjJig/KIzBw38/tN 2/eCq4DVdtMxsyzlwdriQaB2KhC8g5aGXMY0PGEeA1nAVfxqtx2ZiFe909VjZfR3NbtS b8KqAZxWP44x7jqpbr3DN/JpCzaYFUNpILGGZC/Ki3q+tRaE6GJLvIoDd5xxDj+1hxct jyqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=KPEXD3mz; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=e82lqkks; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si5746815pls.181.2019.03.11.11.05.56; Mon, 11 Mar 2019 11:06:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=KPEXD3mz; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=e82lqkks; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727668AbfCKSFi (ORCPT + 99 others); Mon, 11 Mar 2019 14:05:38 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:40008 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727611AbfCKSFg (ORCPT ); Mon, 11 Mar 2019 14:05:36 -0400 Received: from pps.filterd (m0044008.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2BI2jln020265; Mon, 11 Mar 2019 11:05:05 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=facebook; bh=RLwKrC/voF+3rND48JyAOGO3PFc84l3SvAWoXb5wgrY=; b=KPEXD3mzBPwYSbMbkvxCzNCT+rxGZMc0lwGQ0NThdHp3WkrZL8/0YgmYoHOCPS71u/sN H2etAjPLbR5dr++BPkXPNeyJH9o79JxiPjDHL3zxchqWvOVscsE3uATXK2d3vWXCTABT x7prnoeug43vQ0n/eTGdtZKKIWfa/zB/Yms= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2r5ubf0b0d-13 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 11 Mar 2019 11:05:05 -0700 Received: from prn-mbx07.TheFacebook.com (2620:10d:c081:6::21) by prn-hub03.TheFacebook.com (2620:10d:c081:35::127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.1713.5; Mon, 11 Mar 2019 11:04:42 -0700 Received: from prn-hub05.TheFacebook.com (2620:10d:c081:35::129) by prn-mbx07.TheFacebook.com (2620:10d:c081:6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.1713.5; Mon, 11 Mar 2019 11:04:41 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.1713.5 via Frontend Transport; Mon, 11 Mar 2019 11:04:41 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RLwKrC/voF+3rND48JyAOGO3PFc84l3SvAWoXb5wgrY=; b=e82lqkksveQn2NrhJaEAWc6bEA7fY+KZhoN4KI07laI9GGBzZfdLn3vfNbYcZt3CoyDpmLCPCsCXoU0KBwRM50w+TNW+Fci1FeOnc5DLAUX/KhN3iRzEoojKBFUdB33gH9JL7UsK9VOehpKFdFoecFnalKEZ6/IUl7q1i1phP5Q= Received: from MWHPR15MB1165.namprd15.prod.outlook.com (10.175.2.19) by MWHPR15MB1117.namprd15.prod.outlook.com (10.175.2.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.20; Mon, 11 Mar 2019 18:04:40 +0000 Received: from MWHPR15MB1165.namprd15.prod.outlook.com ([fe80::f190:6de5:7e3:e065]) by MWHPR15MB1165.namprd15.prod.outlook.com ([fe80::f190:6de5:7e3:e065%6]) with mapi id 15.20.1686.021; Mon, 11 Mar 2019 18:04:39 +0000 From: Song Liu To: Jiri Olsa CC: "bpf@vger.kernel.org" , Networking , linux-kernel , "ast@kernel.org" , "daniel@iogearbox.net" , Kernel Team , "peterz@infradead.org" , "acme@redhat.com" , "jolsa@kernel.org" , "namhyung@kernel.org" Subject: Re: [PATCH v7 perf,bpf 12/15] perf, bpf: enable annotation of bpf program Thread-Topic: [PATCH v7 perf,bpf 12/15] perf, bpf: enable annotation of bpf program Thread-Index: AQHU1Q94d1kU5xxUhU2jOkg31L0NcKYGvXCAgAACOQA= Date: Mon, 11 Mar 2019 18:04:39 +0000 Message-ID: References: <20190307175810.249857-1-songliubraving@fb.com> <20190307175810.249857-13-songliubraving@fb.com> <20190311175641.GA19721@krava> In-Reply-To: <20190311175641.GA19721@krava> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3445.102.3) x-originating-ip: [2620:10d:c090:200::2:e2c1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c5e03e61-0b4b-4328-8543-08d6a64c07e5 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020);SRVR:MWHPR15MB1117; x-ms-traffictypediagnostic: MWHPR15MB1117: x-microsoft-exchange-diagnostics: 1;MWHPR15MB1117;20:y2eezelV8xICAwyXZr22mTaRaxeVeay0zlzWoYZjRzz8mC5Zzw3SGHFbTjbd663Sq8pRnCppIDNybDz/ICRxlgzvW0/WwIe0ZmgUQuhpRzkShzfdvdpy1K5HYE46unP3EbanKHqLwFqVRfJMuYiHbj/1Ba7QvdCoS+E7Z51541A= x-microsoft-antispam-prvs: x-forefront-prvs: 09730BD177 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(136003)(366004)(346002)(396003)(376002)(189003)(199004)(6116002)(71190400001)(71200400001)(2616005)(54906003)(83716004)(486006)(36756003)(6512007)(476003)(478600001)(316002)(11346002)(68736007)(76176011)(2906002)(7416002)(46003)(82746002)(25786009)(6916009)(6246003)(86362001)(99286004)(7736002)(81166006)(81156014)(14454004)(8936002)(57306001)(4326008)(97736004)(6506007)(53546011)(50226002)(256004)(186003)(33656002)(8676002)(53936002)(229853002)(446003)(5660300002)(102836004)(305945005)(6436002)(106356001)(105586002)(6486002)(142933001);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR15MB1117;H:MWHPR15MB1165.namprd15.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: fb.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: kMPo5J6YU7CGD473fuKMLJdqiMc5PBGLTPJG9C71q1duv12PALMOS2EuRuAAvndWDjSzGHi0cbhnnEa5TKhVU6HrY0JgDvb4xNKUdHTzg+b4GfSKy5TMSmEWB4T37yx0eOa2Qy/ZVjLUHJEXC2yOJX/bVO9rDkcfTvXOwaW3ixcDkz4e2KqDNGMKcNBK4TXzTY7EKgTUIW2uQJGkuyTHmoXrt64NUYNK/EpYXEkDH7uUupJRjUo+Qq7yIuddyvbszbepr8qlPeJ7f0c9lKMQX59zbi1z7NG2tJQRDxVKLozX+sKNuqJYV9q4tRMj/OIC+r7r2CDhV2qo/BSXBwpoRTt1/gUPHgSyyJbW8zGEP/oZcs5Sf2ja+77ofe8LksXmwbWdtU+fbbqfsqcxEojfwGuHg6phwXcRLyqX4K6vA9c= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c5e03e61-0b4b-4328-8543-08d6a64c07e5 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2019 18:04:39.8540 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1117 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-11_13:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 11, 2019, at 10:56 AM, Jiri Olsa wrote: >=20 > On Thu, Mar 07, 2019 at 09:58:07AM -0800, Song Liu wrote: >=20 > SNIP >=20 >> + if (linfo && btf) { >> + srcline =3D btf__name_by_offset(btf, linfo->line_off); >> + nr_skip++; >> + } else >> + srcline =3D NULL; >> + >> + fprintf(s, "\n"); >> + prev_buf_size =3D buf_size; >> + fflush(s); >> + >> + if (!opts->hide_src_code && srcline) { >> + args->offset =3D -1; >> + args->line =3D strdup(srcline); >> + args->line_nr =3D 0; >> + args->ms.sym =3D sym; >> + dl =3D disasm_line__new(args); >> + if (dl) { >> + annotation_line__add(&dl->al, >> + ¬es->src->source); >> + } >> + } >=20 > I still miss answer for why is the line added twice for > !opts->hide_src_code && srcline ? code up and down >=20 > jirka The line above (under "!hide_src_code && srcline") is the src code=20 line; while the one below is the disassemble output. We only show the=20 source code when "!hide_src_code && srcline" is true.=20 Thanks, Song >> + >> + args->offset =3D pc; >> + args->line =3D buf + prev_buf_size; >> + args->line_nr =3D 0; >> + args->ms.sym =3D sym; >> + dl =3D disasm_line__new(args); >> + if (dl) >> + annotation_line__add(&dl->al, ¬es->src->source); >> + >> + pc +=3D count; >> + } while (count > 0 && pc < len); >=20 > SNIP