Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5560274ybh; Wed, 7 Aug 2019 07:58:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzumqHjBd4/0dY1U1GswXyVsHl9Hwpkhvb7Uh37yaCeGd2yxqA3cFDgVdnpIjv1ZVj1Px5e X-Received: by 2002:a17:902:c509:: with SMTP id o9mr8696005plx.222.1565189893177; Wed, 07 Aug 2019 07:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565189893; cv=none; d=google.com; s=arc-20160816; b=QXlCsg/v0jfcGy8Y226S/sc5FwvUIMulAtRSD10fnDX6AYa+Inv/ePhPMNaTwtXF4/ ulBG0kM1X//XjXBm8IYVxmh8HFst40iSR2lJq6RJdPehrLwnxR5oSXl31d7Pn1MmgGS4 9SPZfLXXPwUH+6JFoWLLmWQPWoPwXkaH2xstcBUp8g8C59Hcaz51rtl8sE/AW9Hdyfz/ JhDdSnkXLbTYWDxKwliQgzChlM5B1pJnjKfmbqNac2Gztvt1z8WmgXuJ+N5m/uoZdkS5 2fAooW7eelnTeH43NRJxROpDy5DI0QkIUhtCllbnhgarJVeNV5Oigc4RY7vmx/51JQT2 G4lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=WxrDZfrPFE+RvJaiBPECJUVgzxPWUEvRSCLWbbN/jLk=; b=bsMYogO3RYqBVeqBmKGSmKdTIlFS+fKceBlILalS05vLjr6sPf/Cd8DO5vIdqzVT7N 0oszOuXLZgCCYrdHaZl9J3OL+dYdhmfuCVll3tMJ7tP/T5jSUh6hx3Usmr7VkccwfOIy MRpIaQ9Jk47C80zKQKxnA/PwsXNAMlOMeSb8hpu3oG53rY4D31qQ0P7WUHtsxK5+6/o5 I8tyaOINntnIiTzRKk3wf78EoL3+USYwSVgcuDY87yCgCV1oz1wNYyC5QqW/CSZ3i8Rt RdIhk0CgNkKrXl6dbO0JHj5QYJdVSb6rwUZdyf2hQpOALZydNYiNrR6My1LJ5uSKwCMA 4mcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@akamai.com header.s=jan2016.eng header.b=T48ll+Cd; 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=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si49439511plt.30.2019.08.07.07.57.56; Wed, 07 Aug 2019 07:58:13 -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=@akamai.com header.s=jan2016.eng header.b=T48ll+Cd; 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=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730117AbfHGO5L (ORCPT + 99 others); Wed, 7 Aug 2019 10:57:11 -0400 Received: from mx0b-00190b01.pphosted.com ([67.231.157.127]:43520 "EHLO mx0b-00190b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729278AbfHGO5L (ORCPT ); Wed, 7 Aug 2019 10:57:11 -0400 Received: from pps.filterd (m0122330.ppops.net [127.0.0.1]) by mx0b-00190b01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x77ErAVF027634; Wed, 7 Aug 2019 15:56:51 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=jan2016.eng; bh=WxrDZfrPFE+RvJaiBPECJUVgzxPWUEvRSCLWbbN/jLk=; b=T48ll+CdytcVMYVJht4s5V/Qo58ccg6Saf61fFUqb7kioyMPCy7QTcrFwn2J51JV5HKM b21otkH0kD9m18HPCv/AtH8Qo04YnRUNj5FJ1Ep9iSFnB4t3xSaq66pPSpmvJ34O2dLI 3by81euhHtYjvYhqe4TOQ/JIysuCRHSnxtGK5WF53eTwtVEkGVwA+zvtU7HMi6FKV2iI CUAK8DobFVgnrFyxdBUnNY1SlBFeczgjMeBmiUsmcs7oI8eI6xhDi3z18o9SdiGA4qB7 754UjvgtIDgU4TU0ZmlzOlLBoX9YWD2zjyT85Vlr4jLEQB3znHoGPFrrZiwx4XvRg88U jg== Received: from prod-mail-ppoint6 (prod-mail-ppoint6.akamai.com [184.51.33.61] (may be forged)) by mx0b-00190b01.pphosted.com with ESMTP id 2u51wv18qb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Aug 2019 15:56:50 +0100 Received: from pps.filterd (prod-mail-ppoint6.akamai.com [127.0.0.1]) by prod-mail-ppoint6.akamai.com (8.16.0.27/8.16.0.27) with SMTP id x77ElwIP032212; Wed, 7 Aug 2019 10:56:50 -0400 Received: from email.msg.corp.akamai.com ([172.27.123.33]) by prod-mail-ppoint6.akamai.com with ESMTP id 2u55kw7b2a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 07 Aug 2019 10:56:50 -0400 Received: from usma1ex-dag1mb6.msg.corp.akamai.com (172.27.123.65) by usma1ex-dag1mb3.msg.corp.akamai.com (172.27.123.103) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 7 Aug 2019 10:56:49 -0400 Received: from usma1ex-dag1mb6.msg.corp.akamai.com ([172.27.123.65]) by usma1ex-dag1mb6.msg.corp.akamai.com ([172.27.123.65]) with mapi id 15.00.1473.005; Wed, 7 Aug 2019 10:56:49 -0400 From: "Lubashev, Igor" To: Jiri Olsa , Alexey Budankov CC: "linux-kernel@vger.kernel.org" , "Arnaldo Carvalho de Melo" , Mathieu Poirier , Peter Zijlstra , "Ingo Molnar" , Alexander Shishkin , Namhyung Kim , Suzuki K Poulose , "linux-arm-kernel@lists.infradead.org" , James Morris Subject: RE: [PATCH v2 2/4] perf: Use CAP_SYS_ADMIN with perf_event_paranoid checks Thread-Topic: [PATCH v2 2/4] perf: Use CAP_SYS_ADMIN with perf_event_paranoid checks Thread-Index: AQHVTNFKCXp+3LpVfE2FoOm2P/P8Y6bv1MsA///vEXA= Date: Wed, 7 Aug 2019 14:56:49 +0000 Message-ID: References: <70ce92d9c252bbafa883a6b5b3c96cf10d1a5b31.1565146171.git.ilubashe@akamai.com> <20190807114602.GB9605@krava> In-Reply-To: <20190807114602.GB9605@krava> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [172.19.34.37] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-07_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908070158 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-07_03:2019-08-07,2019-08-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 phishscore=0 clxscore=1015 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1906280000 definitions=main-1908070159 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, August 7 at 2019 7:46 AM Jiri Olsa wrote: > On Tue, Aug 06, 2019 at 11:35:55PM -0400, Igor Lubashev wrote: > > The kernel is using CAP_SYS_ADMIN instead of euid=3D=3D0 to override > > perf_event_paranoid check. Make perf do the same. > > > > Signed-off-by: Igor Lubashev > > --- > > tools/perf/arch/arm/util/cs-etm.c | 3 ++- > > tools/perf/arch/arm64/util/arm-spe.c | 4 ++-- > > tools/perf/arch/x86/util/intel-bts.c | 3 ++- > > tools/perf/arch/x86/util/intel-pt.c | 2 +- > > tools/perf/util/evsel.c | 2 +- > > 5 files changed, 8 insertions(+), 6 deletions(-) > > SNIP > > --- a/tools/perf/arch/arm64/util/arm-spe.c > > +++ b/tools/perf/arch/arm64/util/arm-spe.c > > @@ -12,6 +12,7 @@ > > #include > > > > #include "../../util/cpumap.h" > > +#include "../../util/event.h" > > #include "../../util/evsel.h" > > #include "../../util/evlist.h" > > #include "../../util/session.h" > > @@ -65,8 +66,7 @@ static int arm_spe_recording_options(struct > auxtrace_record *itr, > > struct arm_spe_recording *sper =3D > > container_of(itr, struct arm_spe_recording, itr); > > struct perf_pmu *arm_spe_pmu =3D sper->arm_spe_pmu; > > - struct evsel *evsel, *arm_spe_evsel =3D NULL; >=20 > wouldn't this removal break the compilation on arm? >=20 > jirka >=20 > > - bool privileged =3D geteuid() =3D=3D 0 || perf_event_paranoid() < 0; > > + bool privileged =3D perf_event_paranoid_check(-1); > > struct evsel *tracking_evsel; > > int err; >=20 > SNIP Mea culpa! (An artifact of a bad rebase.) Just learned to cross-compile. = Thanks, Alexey and Jirka! The v3 with the fix has been posted (https://lkml.kernel.org/lkml/cover.156= 5188228.git.ilubashe@akamai.com). - Igor