Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2666904ybv; Sat, 15 Feb 2020 00:44:10 -0800 (PST) X-Google-Smtp-Source: APXvYqydv5jHjRUGJ4mXndEd+EsvpujPsbNMVgfLk5wLI5vr31mOIYzQfWTzQBKXepXU0xWbisjN X-Received: by 2002:aca:f10:: with SMTP id 16mr4269044oip.117.1581756250214; Sat, 15 Feb 2020 00:44:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581756250; cv=none; d=google.com; s=arc-20160816; b=ewifF9+oq0xnwYAVKhh8coB+MWJriciqdX1+Mx+B8y6AdEuX9lQJYKRm8VXbZSfUc8 YqYyZq+KzJMQ5hn+V2lko1sk571r93veOpSuF8crj2Uobann7b2Xx4KhI0U76HAKRJhh qKybWYF7o9rXP2QXfu2QwHhQbo0jBOvfiekrzPy0jbdsltRRJxRK561+ZS4V+PBozri2 2S1pag3E9iZnmvxIWgX44mKwbhiZRBz+BhktNz6vz54vaPt1BjThxNVwpK9Jy6L95tt2 M2pgdbfq4uAWTigwUXCQmcgXB1JzXsMSRncN8pPQVR7X9oqopldEN3x8znI7gsVpRKFp Hypg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=5wqMmfLGxY9i+rz4Z9YUhUkaeccFTNpd63eqIHsWs1w=; b=Abeh14a/nGaUVLqCLlwM4KXHkthMpgSsZ+4JTw/rypS7eFGYp7wkBk4n3G+k40/AdG LIty1crtUjzJ/+EE2FrTTjyv5WQ8BgGHRDKaofpB5orBUFrpYWhSSRBlwDFF3K+5xVuz 4SP/HoSOnbyYMNLT0IyXkpPq4YitXgwFOqiWhc/mD0+5ay7bxEuUPuv1l8gXpe0IpVqx 2WkHgEsW2gTOmnzRjBkdBNj6PiSE8hWjN5gnDGn7PIhHDZGA5zTyv6JGx2Qgmzc+24i9 MwWTCrMwP3T0EAZNY+0WdZI5YH0GAzX82FUvSbeK6P/u6VAZE1MVy/5NR90dhltOOCE3 ebiQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si3877180oip.107.2020.02.15.00.43.58; Sat, 15 Feb 2020 00:44:10 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727668AbgBOImR (ORCPT + 99 others); Sat, 15 Feb 2020 03:42:17 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:56813 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726540AbgBOImE (ORCPT ); Sat, 15 Feb 2020 03:42:04 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j2t1N-0005I6-KU; Sat, 15 Feb 2020 09:41:53 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 424561C205E; Sat, 15 Feb 2020 09:41:53 +0100 (CET) Date: Sat, 15 Feb 2020 08:41:52 -0000 From: "tip-bot2 for Jiri Olsa" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf maps: Mark ksymbol DSOs with kernel type Cc: Ravi Bangoria , Jiri Olsa , Kim Phillips , Alexander Shishkin , Michael Petlan , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , x86 , LKML In-Reply-To: <20200210200847.GA36715@krava> References: <20200210200847.GA36715@krava> MIME-Version: 1.0 Message-ID: <158175611298.13786.3290516837550970527.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/urgent branch of tip: Commit-ID: 4a4eb6154d67f7766cc7eb74e9f1db424073e832 Gitweb: https://git.kernel.org/tip/4a4eb6154d67f7766cc7eb74e9f1db424073e832 Author: Jiri Olsa AuthorDate: Mon, 10 Feb 2020 21:08:47 +01:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Tue, 11 Feb 2020 16:41:49 -03:00 perf maps: Mark ksymbol DSOs with kernel type We add ksymbol map into machine->kmaps, so it needs to be created as 'struct kmap', which is dependent on its dso having kernel type. Reported-by: Ravi Bangoria Signed-off-by: Jiri Olsa Tested-by: Ravi Bangoria Tested-by: Kim Phillips Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200210200847.GA36715@krava Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/machine.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index e3e5490..0ad0265 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -727,9 +727,17 @@ static int machine__process_ksymbol_register(struct machine *machine, struct map *map = maps__find(&machine->kmaps, event->ksymbol.addr); if (!map) { - map = dso__new_map(event->ksymbol.name); - if (!map) + struct dso *dso = dso__new(event->ksymbol.name); + + if (dso) { + dso->kernel = DSO_TYPE_KERNEL; + map = map__new2(0, dso); + } + + if (!dso || !map) { + dso__put(dso); return -ENOMEM; + } map->start = event->ksymbol.addr; map->end = map->start + event->ksymbol.len;