Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5778807yba; Mon, 13 May 2019 17:38:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9mdnlFA9MbQy+HK4S5o7l0zW/CQlEUbtdsS6v+0v9jc7fUWwyfhhzRbU6qlf81RCTGJ9l X-Received: by 2002:a17:902:294a:: with SMTP id g68mr8835601plb.169.1557794284775; Mon, 13 May 2019 17:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557794284; cv=none; d=google.com; s=arc-20160816; b=QXgF9iXTmInu5nXM0/ZrJpIb9EYDZba82zkaBhyMqLU4zScwfkR3rGn0n7R3RBnRs+ jM5D6V8lNaEZBMU774WjgbU11x4/AlkHLBFH8hi1vK8xiCDDtBwmMy5M7fnAAdpOGA6L qzqSj+Q9zPwDitQ3ZRwdiT/z2MG70tOeHIqMKr8aLalNdXZNKxKmlR2SwW9FWc5btyT/ ydXpFP4v8OI396dPVyblxNlisnA9aKIkflfbwb8SDj7bV5NCWHxAk4IEckeovgyX/ub4 YsJHaR1kJCD7AWEEM0ZDJA8JOYEsgVcS2P7u49N/LNsZEIks2t8vgsnE6RG9S9CR0pRS wPFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=cQYS69pnKdMx3gTO+F+7L60HZWMlBVLEQe2DQzgIjmQ=; b=nFJ1fCZL4vIn8k+BFpaqg5ry2fDchBDgSRLTgHvTuqNKARJYL9TGlULeDsrRNlG/NM 635/B4BISlJM/A1HPlHxOQzBQTVeLYe3pX1OoCfCYqT1X3ZivYGtACzPcB9KJPbWsslD ZWX6/BiX29AhX9Jciie7E4qlvwM9Gv4yqhwTH81FR1DZpTfUMVfaxFROEtl9+JHbpO/S 7/TH2+Fq2d35AHUoNL0oxDWgPs024gwTmreB+PU9k3wFX8mcW64bY7f9qU9iTR0v+JuG I2AeXOybHbWQBEDlwsF6Awz5Na0FFMZkAoPS2tYqhu/m06lgZcK5HUHKk/0Bm/ePtoE0 N7zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DmaXwPUu; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si18042986pgq.202.2019.05.13.17.37.48; Mon, 13 May 2019 17:38:04 -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=@google.com header.s=20161025 header.b=DmaXwPUu; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726833AbfENAfL (ORCPT + 99 others); Mon, 13 May 2019 20:35:11 -0400 Received: from mail-yw1-f73.google.com ([209.85.161.73]:49695 "EHLO mail-yw1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726233AbfENAfK (ORCPT ); Mon, 13 May 2019 20:35:10 -0400 Received: by mail-yw1-f73.google.com with SMTP id v123so28332246ywf.16 for ; Mon, 13 May 2019 17:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=cQYS69pnKdMx3gTO+F+7L60HZWMlBVLEQe2DQzgIjmQ=; b=DmaXwPUuWIZMqSn3Lsqr881WEcVU27uNFKq/wiCngB4z8Zzw9SPR1itbmxkurWaCGj HxExxQXTVwHuFlqxg9Ua8Y/2PGoxyQvRgboX8EsKaLuXc7XGe7ijMvfbFo/EWGOBaGix SHvw6RLvCz7KTBEmnarZo3gSNYNBoAvCJrpq5/sdvbMlhw1QL/XoGdeQFKFyojg/nQwK DCvLMtAQEM8Wy6aFmNCuNEHIPxNiMfIG6/yOjqnELveRZtT6mEa1ToIv/mCy/ssO1a8a mszckrZjoviua2DCVZxW173T+Bf70pLXqbtYqmI8RvdRYsGf3r+WvOQGI56ppJ9FDAa0 LXpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=cQYS69pnKdMx3gTO+F+7L60HZWMlBVLEQe2DQzgIjmQ=; b=NPFYgBEGgon5s6Vh4WI4BAhbBo6ivWvt10aFr4ft4RgBk9b9BXMMuvbUKQzFfC9ZGu chwcCSN94sXmGDACRLsp9E6z5S8MfomGXkrHRKi24t1Oz8ATogjS4qDcDMiZCuH3g49+ SaqSzxQqYVGIhB6rBanM0GgkDxcvQnBXcxz13lJpt5/cTtGhSdut6TPKUYwEZG4p9or1 jiEK7IfPPZDwpYZ4FHLWZQJ3stMnC93QvLOJLYFAJlLwZHO63/1rkYYzccZuAe8QSz1j Xpfkkv3HexAAnlnfwm1t6WHpsgkNeRDsDb8ZHZAGS8JlIYw2Y3yzgXAwMyGCCbJC1EcQ aU/Q== X-Gm-Message-State: APjAAAVE4OUXsQ7INEr2RF5F4a7tn2eU7/LyfR+icamgo8f1eICJTquT i97uTlL8zqV7Eq9788QlLDcfyZaWoOKcYI1McumPqoSEgwtZSPr8xRJKaTHohk1YlNn6Fx8p0Mo bZfyLaQJ9PXbfyYM/jwA2ukiyq4G+HxAoOOP9ZUfIqY9B1daRbVoBHeDEj3seVw2s7UD8PMcR X-Received: by 2002:a25:3b43:: with SMTP id i64mr15016395yba.477.1557794109918; Mon, 13 May 2019 17:35:09 -0700 (PDT) Date: Mon, 13 May 2019 17:34:00 -0700 Message-Id: <20190514003400.224340-1-eranian@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog Subject: [PATCH] perf/x86/intel: allow PEBS multi-entry in watermark mode From: Stephane Eranian To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, ak@linux.intel.com, kan.liang@intel.com, mingo@elte.hu, jolsa@redhat.com, vincent.weaver@maine.edu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch fixes an issue introduced with: 583feb08e7f7 ("perf/x86/intel: Fix handling of wakeup_events for multi-entry PEBS") The original patch prevented using multi-entry PEBS when wakeup_events != 0. However given that wakeup_events is part of a union with wakeup_watermark, it means that in watermark mode, PEBS multi-entry is also disabled which is not the intent. This patch fixes this by checking is watermark mode is enabled. Signed-off-by: Stephane Eranian Change-Id: I8362bbcf9035c860b64b4c2e8faf310ebd74c234 --- arch/x86/events/intel/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 416233f92b3c..613fabba2c99 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -3280,7 +3280,7 @@ static int intel_pmu_hw_config(struct perf_event *event) return ret; if (event->attr.precise_ip) { - if (!(event->attr.freq || event->attr.wakeup_events)) { + if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) { event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD; if (!(event->attr.sample_type & ~intel_pmu_large_pebs_flags(event)))