Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2450002pxk; Mon, 14 Sep 2020 13:46:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcTTR0c+CLpZh6Ve3mjerFkdcNfBRfuMP0ChUmB4++tWZ09R0JLNS9ZjGo52fhiDmQ9iqN X-Received: by 2002:a50:ee10:: with SMTP id g16mr19932144eds.258.1600116392016; Mon, 14 Sep 2020 13:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600116392; cv=none; d=google.com; s=arc-20160816; b=pdiGItYJMpXtBxWotfBSiAiAS2P/ZciwwVqoLEjRVt70JxuYX9meKB+q0vSjXkqkTj FOfpjeOFiKhEPIZaN912tUc2B/8WQFeXyKXO3dm0oh4NpWERn+8bY4POaBmoW7g3nM5l SuK7cw5kST6uKqHO5ae9XmMHS2jvXhrwHkyFOs0pmQ7v+Dyyd1qd+pkgHVXwy7f05Jws E45ih2Tt9UpJxTCyO+aPy45zD6YEnMKO//IgHtGJrBjB6JcBkQIbvhjtgMbf486zKf61 I/dfC5tN+1cLpjCKSUygbjNUITmcUCrALSZn2Mg+XujmyICy0cLpok7Tl2t6scUt2Dhs KgTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=QSo7z5EhrZIrn1Cf9pd30WNNDxr/GZahZc5xQPbEOOY=; b=RWG0eI0YRcFbl89bLFFzGGEArNJroGDuNhQg0FA+h0LKVhZdOlW0iSSOt7jHVP/GFM 7v3kdNeQqFUbYz7MEajC5wp8kIXyIKa+CrsN5T+yiF7i54uE+K4ZV+/yYAud6RS4/HN6 Acm6sitGIXUz7FSgD9OAjXwqitqcDEyhAyOpjUaKMyWYDCApU7vAeGox1AFFC7VfRWvu vK5o7YMZ0UZwd7cTnbMJ/0KnKdqcmYtuNrgiojUqqGxXeBLKGgW8NkT8tWO1Q2qQEVjB XwF/BhSIvnKDvCeQVeTYLbgnXFu5JQzTqkWVU59edTLWu+pQiuExKSm3n5w6Qd9sER7z eUJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Rq7UfjlS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i5si7680870ejs.267.2020.09.14.13.46.09; Mon, 14 Sep 2020 13:46:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Rq7UfjlS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726135AbgINUnI (ORCPT + 99 others); Mon, 14 Sep 2020 16:43:08 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:29786 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726009AbgINUnH (ORCPT ); Mon, 14 Sep 2020 16:43:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600116185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QSo7z5EhrZIrn1Cf9pd30WNNDxr/GZahZc5xQPbEOOY=; b=Rq7UfjlSzSOGsBl0EOG4a2VfJsZozEDmziH5x5PAXxzxKt6yj9mSbYf/B9SrQr2LagJ5z+ mfM4DjXn68qc2VIcqiN9kQGoUQSEAX0Cytx0UyP5S43pog91GP8w7GBK5P9ooKDpogbFAN 7S8wOlzrFCYHYmzZ3UcqtZ3/G/OoxR0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-459-4h2zvrPkPgS103df3V-SRA-1; Mon, 14 Sep 2020 16:43:02 -0400 X-MC-Unique: 4h2zvrPkPgS103df3V-SRA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F05131005E67; Mon, 14 Sep 2020 20:42:59 +0000 (UTC) Received: from krava (unknown [10.40.192.180]) by smtp.corp.redhat.com (Postfix) with SMTP id 5DD341A914; Mon, 14 Sep 2020 20:42:56 +0000 (UTC) Date: Mon, 14 Sep 2020 22:42:55 +0200 From: Jiri Olsa To: Namhyung Kim Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Michael Petlan , Song Liu , "Frank Ch. Eigler" , Ian Rogers , Stephane Eranian , Alexey Budankov , Andi Kleen , Adrian Hunter Subject: Re: [PATCH 24/26] perf tools: Add buildid-list --store option Message-ID: <20200914204255.GX1714160@krava> References: <20200913210313.1985612-1-jolsa@kernel.org> <20200913210313.1985612-25-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 14, 2020 at 03:42:55PM +0900, Namhyung Kim wrote: > On Mon, Sep 14, 2020 at 6:05 AM Jiri Olsa wrote: > > > > Adding buildid-list --store option to populate > > .debug data with build id files. > > Hmm.. isn't it better to add it to the buildid-cache command? > > + * - store binary to build id database > > + */ > > + is_kallsyms = !strcmp(machine->mmap_name, dso->short_name); > > + build_id__sprintf(dso->build_id, sizeof(dso->build_id), sbuild_id); > > + > > + if (is_kallsyms) { > > + /* > > + * Find out if we are on the same kernel as perf.data > > + * and keel kallsyms in that case. > > + */ > > + path = strdup(dso->long_name); > > + if (!path) > > + goto out_err; > > + > > + err = sysfs__read_build_id("/sys/kernel/notes", &bid, sizeof(bid)); > > + if (err < 0) > > + goto out_err; > > + } else { > > + struct stat st; > > + > > + /* > > + * Does the file exists in the first place, if it does, > > + * resolve path and read the build id. > > + */ > > + if (stat(dso->long_name, &st)) { > > + zfree(&path); > > + goto try_download; > > + } > > + > > + path = nsinfo__realpath(dso->long_name, dso->nsinfo); > > + if (!path) > > + goto out_err; > > + > > + err = filename__read_build_id(path, &bid, sizeof(bid)); > > Is it ok to read the file out of the namespace? right, I need to enclose the whole part into nsinfo__mountns_* thanks, jirka