Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp494582lqd; Wed, 24 Apr 2024 08:23:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXGNPwEu1Jlci0O3w5H3F3lK601GQASYfU2HJI7usNqTeF0/1vc1JnZ5x7VRi02xvKdkgZ5cQRAXrHq2MvSzCJSMGuh0dRwJVL2UszbVg== X-Google-Smtp-Source: AGHT+IFiGykJvwf9V9GSwj//dedLXQkbYTcumVxbV6JV/Fb0ISi/t++vmQ7liAJsdT0zCemwt2Du X-Received: by 2002:a05:6a20:9705:b0:1a3:1972:450e with SMTP id hr5-20020a056a20970500b001a31972450emr2574274pzc.50.1713972209331; Wed, 24 Apr 2024 08:23:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713972209; cv=pass; d=google.com; s=arc-20160816; b=DRrgsGyQoPIqW6FTjhXNZE81uuk6C6pD8aEbeteo3O/76BknpO3O+YqQYHns7pRrqC kKLkncLgX+cIqpWk/R9jpqYxCSuYej7oh1lxLltpsF3B+D4CYZBmrEWmhfjDtGoLDWBp XTLInFIe5UGlqXIrT9XjQDzonyYv3nuMFyuu84Hbs8VGIhyyZOKLUlYUKaX0z4vltMQA ARNkAuBOsghAFxnuyo57H5rAPnh5a/707/d3TvcS4iWj8jJzpufWV2Uszzds+tIuc86/ ncpP9MTIxXX/3wKI1w1CnIwPA7+ovTTx2NNoCMyZTpjQM4iehQqbIFtEWtq+SjaEhLQv Qp0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=16IfUr/aDIVyiGDdNYlmv/QESeSDyKp3ic+JdrAeLjo=; fh=TQH41D8RWIeGfNuFby3IzFcrkDLZSv6YLpUgursJNoM=; b=NuGATyHl7PtCoGDT9PZGVWg1m+/M6NQtCw/9e80gGUsbYqSv1KeXFPS5OKcI5J+JVJ 9Z/Q4C4UXA4SAqfSENK8JKXbNNph4PMMyOlKr9w3nIfDcF2EupiDu945nde2FJvE18nO 72f6mL6DsmRf0zNkTSzekev6CJttFzCPJdsGSMb3EvPZNhnShlcWX4OsIRsBySclWil+ f2Xct/fNaP2BFVnI/X6+yqnfSVALZT7NgAKzalrFHiJQ+HuRqrUqDYnSyeF7Gu87UvP0 4Ycynq3xk0jC/7WF38DAO4vcfVD+lEV/QKF8Du/YANQuY1D6d0YVuVyuZ86wLLDa2MeR 7VOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=feRz2wqM; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-157179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q11-20020a170902f78b00b001e589f828a7si11567193pln.487.2024.04.24.08.23.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 08:23:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=feRz2wqM; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-157179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5EA1228C515 for ; Wed, 24 Apr 2024 15:19:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3585D15F321; Wed, 24 Apr 2024 15:19:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="feRz2wqM" Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E38AB15F30E for ; Wed, 24 Apr 2024 15:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713971949; cv=none; b=k+ajoj3cTVlqachKO6HQKjqZ0tHwncisBsP6SSKvfDWiWoSZYM/aLVSz4w1iWO7ou8vvSF/VJj3YQIWI9dHmeKK3vn5OJKhXuudhirBJY6U2fNeMuNpF0/eI+xVCowLIqqRyLW3Rm9JMvzKrBziyafcaovZdmOde+W/Fd5lETXA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713971949; c=relaxed/simple; bh=zo6CfEdwy0Z1jFqYaKi4gjp+7PfLdUHzWaLTgeGkHGY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bAY/c5lYchQIoquWwrd8WPOCAeYSzjEZnyDl4iiFLOGEDCLpYD4ktA9tRVxdnDEkhBCrYifjr2f9SrcgjdKtYKQ2xpdHUeRasNlPYMyZoTVU8CRlH1zruNpkCwTnCoFue5p0+ERU0iZhMp0ECnXIkBiTloJGN5v+e9cU1qh3F8E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=feRz2wqM; arc=none smtp.client-ip=209.85.160.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-436ed871225so329821cf.1 for ; Wed, 24 Apr 2024 08:19:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713971947; x=1714576747; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=16IfUr/aDIVyiGDdNYlmv/QESeSDyKp3ic+JdrAeLjo=; b=feRz2wqMghEcvfLAvXv1fx904ZD5M7NaI7j0/XiUAQ50ahuo7PkAqIGbzW05QTXNrL yeqUwFrPRT6WdDBIdokZfPwYVEUpMAZ3nQtuFxDoPhdk8HmMCAiDspUlPiXSvr1LDTu1 eUoOhVVvjD533VovQkhcgnQ7O1HeduVuTlnpqoZ/zpsoF9bWpU3b7bEkE3IdOlIAERFe YRY0fPpfr2cpYMf+gN5IxTRnC++4FozqgFktvl62Ar7qqdkC9NExjxUo5MCLgP7hV9yk 5YJfdCdKxIOkGJAKYXy1ohCfy6LfSDH7fod8XYDPyrlJooq+0aN/pgliaD0pKYJdRhrO vEEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713971947; x=1714576747; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=16IfUr/aDIVyiGDdNYlmv/QESeSDyKp3ic+JdrAeLjo=; b=MsZGQ/fL2w5yyLViKqOCjcXKrnbVGOaT+jcTi3aTpE4lppaz24fPCm0QH02UIZrEZR M9bLnYvX7N6FhR9OisCPVJiz8j328yG50A8JaWs9aZRk7myjajwQnCSzTAwywgxosOeL tJ1JHFCujpbAk2FAD8ArdveckQiwJ4J1FI0AvFSBRT/gNtv0VS0yLjcrNHN6x5OxPIPi aqrENE4N4CGbeRWScHeSmdyEZnuSrPrNzIV4bLI9Pk1GrUzXc/Ui95hIu35aL+HO3nNC mycALZrQlnJzQnv9N0SAeDKUrBWRVM6RyjiKu0FJ0WEJfrqQMltaNiJX6nTAQLe6DkoR Ftqg== X-Forwarded-Encrypted: i=1; AJvYcCWPZ2WRlH+dV7GOSPMMOJpErxned4WuMUoSzzftP7uhYiUiywDXMOcQJzgNdLlXQ47WJKttKVZkFReJRUTpx46n+3F9old2pQt2ZUNr X-Gm-Message-State: AOJu0YzEnpZzywxaTrH7ZaAqCUdqO6IlXQm1+JRvrd7w8RtKlIYAMrRo HNnHFIypPCyO98xWAKipX3dB6kQjT92yjHDt6D1L/OxY0tOCKtNnSGbK6Xp8rbLh4LrbNZkty7E Uf8kuS9FHL7YJwOTDNLYU5fbFMLa6gQb83tMP X-Received: by 2002:ac8:1286:0:b0:43a:2e2b:eec with SMTP id y6-20020ac81286000000b0043a2e2b0eecmr169202qti.2.1713971946704; Wed, 24 Apr 2024 08:19:06 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240416061533.921723-1-irogers@google.com> <20240416061533.921723-14-irogers@google.com> <7df3ff63-a421-42cc-bcaa-b0254ff6a0e8@linux.intel.com> In-Reply-To: <7df3ff63-a421-42cc-bcaa-b0254ff6a0e8@linux.intel.com> From: Ian Rogers Date: Wed, 24 Apr 2024 08:18:52 -0700 Message-ID: Subject: Re: [PATCH v2 13/16] perf parse-events: Improvements to modifier parsing To: "Liang, Kan" Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Atish Patra , linux-riscv@lists.infradead.org, Beeman Strong Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 19, 2024 at 6:20=E2=80=AFAM Liang, Kan wrote: > > > > On 2024-04-19 2:22 a.m., Ian Rogers wrote: > >>> + /* Simple modifiers copied to the evsel. */ > >>> + if (mod.precise) { > >>> + u8 precise =3D evsel->core.attr.precise_ip + mo= d.precise; > >>> + /* > >>> + * precise ip: > >>> + * > >>> + * 0 - SAMPLE_IP can have arbitrary skid > >>> + * 1 - SAMPLE_IP must have constant skid > >>> + * 2 - SAMPLE_IP requested to have 0 skid > >>> + * 3 - SAMPLE_IP must have 0 skid > >>> + * > >>> + * See also PERF_RECORD_MISC_EXACT_IP > >>> + */ > >>> + if (precise > 3) { > >> The pmu_max_precise() should return the max precise the current kernel > >> supports. It checks the /sys/devices/cpu/caps/max_precise. > >> > >> I think we should use that value rather than hard code it to 3. > > I'll add an extra patch to do that. I'm a bit concerned it may break > > event parsing on platforms not supporting max_precise of 3. > > The kernel already rejects the precise_ip > max_precise (using the same > x86_pmu_max_precise()). It should be fine to apply the same logic in the > tool. > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/a= rch/x86/events/core.c#n566 > > Will the extra patch be sent separately? Let's do it separately. I'm concerned about the behavior on AMD (and possibly similar architectures) where certain events support precision like cycles, as they detour to the IBS PMU, but not all events support it. The max_precise should reflect that AMD's Zen core PMU does support precision as a consequence of detouring to IBS, but maybe things in sysfs aren't set up correctly. Thanks, Ian > Thanks, > Kan