Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1314388imc; Mon, 11 Mar 2019 10:57:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyazBLGOgKoN7LkN0ZxXOl39Bz8rWrt6xMZRVTI+UJx7XhgpopCgB9NaPWo4ajWDa5yP//a X-Received: by 2002:aa7:8b03:: with SMTP id f3mr528665pfd.208.1552327045159; Mon, 11 Mar 2019 10:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552327045; cv=none; d=google.com; s=arc-20160816; b=ZG82ehxE2c/9QptH4FQS54KBuYWUUxaYm8MXpYeGSTY28Cwre0JPp+Z66P+kC0oqrl jfw6ZhldlJEP+nvEbeHahsMb3B0yubkWvXgBYFTK2euQFxWCgmbACJKDuVukpw8MfhOx mSkVGwQTbJLSGs/Ixj+nF6nCjBCLIT4AJMTVUsQ8rhmwJvy2Ku0vqUg/bzh1g+9Uqwto 85MZNTvsiBhVJ5iO86Tsfoql+50FSOMby6Ex+BXgaLDXsB3dY5WLjLW66HPBrGmEbx/y t4Ck3gOZNLEAHxXvfzPcgbGvKx4HYBZvQ1TrW1FM44JzsQATHmmFJAhbKfjtaI5KzvLc sQ8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=b3DB1GoWl59mi6sHYlH464Dp/tiL0itwytDixIvLeA0=; b=E1WFIR+4Y6pU9Kb3sMLOIAV+cga+zvyEq6aSJX6GjBhs/X2BnWxdLB8kviWIoFCig+ zRQA6NSUFVls1EJ2putaz0VDKsv5I2bVbnoudtEP2tIZncONiA0cdYe9E0rVQXmRV/K1 G3W2OUpnqVwtuWcPz8eOAURYukF/A+DZ366MvNpXuUlL0Ml30sCE0TKU3fCvRzKNfhZa TcR9qH3HEki+395VxeO/iO65BSjoLbyxkcDxeLfpWVsdDXLBQvGtcqFMOIlqEa9l7d3j ivA9sfCOO5Wmyz0aLOujRtPct6FmM4WjTsXVoLoIX2BRroTzNRU0ppqylj5z8fCI/Lv2 akpw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10si2555614pgp.422.2019.03.11.10.57.08; Mon, 11 Mar 2019 10:57:25 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728110AbfCKR4p (ORCPT + 99 others); Mon, 11 Mar 2019 13:56:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34948 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbfCKR4p (ORCPT ); Mon, 11 Mar 2019 13:56:45 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F92B30833B4; Mon, 11 Mar 2019 17:56:45 +0000 (UTC) Received: from krava (ovpn-204-107.brq.redhat.com [10.40.204.107]) by smtp.corp.redhat.com (Postfix) with SMTP id 27B74608C8; Mon, 11 Mar 2019 17:56:41 +0000 (UTC) Date: Mon, 11 Mar 2019 18:56:41 +0100 From: Jiri Olsa To: Song Liu Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, kernel-team@fb.com, 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 Message-ID: <20190311175641.GA19721@krava> References: <20190307175810.249857-1-songliubraving@fb.com> <20190307175810.249857-13-songliubraving@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190307175810.249857-13-songliubraving@fb.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 11 Mar 2019 17:56:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 07, 2019 at 09:58:07AM -0800, Song Liu wrote: SNIP > + if (linfo && btf) { > + srcline = btf__name_by_offset(btf, linfo->line_off); > + nr_skip++; > + } else > + srcline = NULL; > + > + fprintf(s, "\n"); > + prev_buf_size = buf_size; > + fflush(s); > + > + if (!opts->hide_src_code && srcline) { > + args->offset = -1; > + args->line = strdup(srcline); > + args->line_nr = 0; > + args->ms.sym = sym; > + dl = disasm_line__new(args); > + if (dl) { > + annotation_line__add(&dl->al, > + ¬es->src->source); > + } > + } I still miss answer for why is the line added twice for !opts->hide_src_code && srcline ? code up and down jirka > + > + args->offset = pc; > + args->line = buf + prev_buf_size; > + args->line_nr = 0; > + args->ms.sym = sym; > + dl = disasm_line__new(args); > + if (dl) > + annotation_line__add(&dl->al, ¬es->src->source); > + > + pc += count; > + } while (count > 0 && pc < len); SNIP