Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4791399pxb; Tue, 2 Nov 2021 16:10:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwa0673q5e8NoFn1ahdae/MWdYsLI/cWPACIBPrCzmoljn5OikwRMflJP3c4/hH2vs77g4s X-Received: by 2002:a05:6602:148b:: with SMTP id a11mr29656688iow.85.1635894601377; Tue, 02 Nov 2021 16:10:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635894601; cv=none; d=google.com; s=arc-20160816; b=ygCaJODpVUAHBJQ+YpBtdo04zgfFuizkIN2guk4TATqcojIWtlKGLTYF+pqAqIEwSZ RWWUm/SEd/v6Ay8tZ4QiUdR8YOJOqwcM6mV+JApGLUhHHyeZRoD6xLBLy+NvakgblX4O 92z9H8kRBLqOmEhu+I7DSgsro9TaIhCcnApH4v2ZhNgDDp/fZiClo0lwzOfVy5Cfsi4X 53tkSC1ZiCtKS89VL+aROfLTmgH4CuqSE+UoBsZrFixHIRBPWKbBUFoozXSUWO1Z7Tl9 zeLLehmyJpFSF5MPzTtrH026i1IOqa/zDOsfP3LQqNhTm4G8pz8fWb1hJ0dzBF86eA+N +Y/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=axqqCgDc0zLKZYFe0E+oIe0KfNTY1wneESMS3LuNr28=; b=aGMGmtDYPYNZQcrKjfnOQs5dOhx38afxCN4YP7IJm1JtOTFLFoIM8+D2USAfxAROC/ 6kuAZnHCTdHxz6ddJ58tGLDv69sBSwpsOZHMsUZYKzpj072UoU/L6kX/4Gc6+SpY7ysc NVs25fSl0ngTgrGzXa4xxGwtAYjrRGKe2mhjI3yq1m7lqcT4oFyvLC9dAxZPOaxwWauA bvwtOj1/+/+7w776wy8Hfpr72hSneaaDF/RmTzwKbmmpJGyciFbTAWt26gHCyVMJVNSD rjxB78yXCGKvEfZGDl6KNN0OAooZiP7J4gGX14OA0MZF1H1EH23J7Zs3HymrIlaPAqNf 1E8Q== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t34si552010jal.104.2021.11.02.16.09.47; Tue, 02 Nov 2021 16:10:01 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230331AbhKBXL3 (ORCPT + 99 others); Tue, 2 Nov 2021 19:11:29 -0400 Received: from mail-lj1-f169.google.com ([209.85.208.169]:37756 "EHLO mail-lj1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbhKBXL2 (ORCPT ); Tue, 2 Nov 2021 19:11:28 -0400 Received: by mail-lj1-f169.google.com with SMTP id y8so763453ljm.4 for ; Tue, 02 Nov 2021 16:08:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=axqqCgDc0zLKZYFe0E+oIe0KfNTY1wneESMS3LuNr28=; b=SkDFX1yzm1kEqoruu8qg5/VbwGv8lUuagrJo0KpdZCSGBKuzHkX4YGA4iHyS7vHgXm c5/MJ/ozQvxcCgH+F0c/0RXYkWP7XhuyHyLXnzibkvRj39Pw7WuTNtBFc6t+7DKfX0Ch jjIomFugVn1kaO0XidwDnk4V8APIn80pZwzweC8wXmUAIjXRURCgy8p0xXIOsOC523tv 2aHzfhAshlCu8zR3eW0qAbKBEEWaxolZ5gLcwwOx5P8v8wBUcMSCS7aTJR0QH47SC8Ie tPEgAShvzWWuNzrae53tZcCLIXmVU7PfbF0KelDIzOkZjmKhWMl0OrLk7++QSmLXkCz0 nMNQ== X-Gm-Message-State: AOAM530BcXANCz5UBtDcrx8CQl4oQHFPAqVnUI22s13XMRv9aBvKzTYM ko0nyHbqois1aePKrluosdDrAkfc6TqXx8j34J0= X-Received: by 2002:a05:651c:515:: with SMTP id o21mr9050371ljp.90.1635894532179; Tue, 02 Nov 2021 16:08:52 -0700 (PDT) MIME-Version: 1.0 References: <20211029224929.379505-1-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Tue, 2 Nov 2021 16:08:40 -0700 Message-ID: Subject: Re: [PATCH v3] perf evsel: Fix missing exclude_{host,guest} setting To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Ingo Molnar , Peter Zijlstra , LKML , Andi Kleen , Ian Rogers , Stephane Eranian Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnaldo, On Mon, Nov 1, 2021 at 2:09 PM Arnaldo Carvalho de Melo wrote: > > Em Fri, Oct 29, 2021 at 03:49:29PM -0700, Namhyung Kim escreveu: > > @@ -1900,10 +1935,17 @@ bool evsel__detect_missing_features(struct evsel *evsel) > > perf_missing_features.mmap2 = true; > > pr_debug2_peo("switching off mmap2\n"); > > return true; > > - } else if (!perf_missing_features.exclude_guest && > > - (evsel->core.attr.exclude_guest || evsel->core.attr.exclude_host)) { > > - perf_missing_features.exclude_guest = true; > > - pr_debug2_peo("switching off exclude_guest, exclude_host\n"); > > + } else if ((evsel->core.attr.exclude_guest || evsel->core.attr.exclude_host) && > > + perf_missing_features.pmu != NULL && > > + !hashmap__find(perf_missing_features.pmu, evsel, NULL)) { > > + uintptr_t pmu_features = PERF_MISSING_PMU_EXCLUDE_GUEST; > > + > > + hashmap__add(perf_missing_features.pmu, evsel, (void *)pmu_features); > > Can't hashmap__add() fail? It can. I will add a check. Thanks, Namhyung