Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1430145imm; Fri, 15 Jun 2018 17:50:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL162Wn6xSD6gLwEq6IZVPJqyxtkuhTnbABeIcdsPljCAV4xYqcFwOY/KrBMn7XneBkyY8x X-Received: by 2002:a63:bf49:: with SMTP id i9-v6mr3577754pgo.342.1529110256764; Fri, 15 Jun 2018 17:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529110256; cv=none; d=google.com; s=arc-20160816; b=Er7uhsV//SzY5dByPIvDV3rJKrIQ1Yg0IDfHyP4dtT8oVWeVjg+LBfya5fWa/9xVsm aykMnxBsHQc+dQ4v5gP0rRYAIEm0YhW3dg4aG899Jyro6Iie60VRBIN+oG/XLPUnrqRS 72vpA+4UxxEOgVBtkgsKcGo2G2wAv0UoopG1EBahBMNSHyZU0ArX5nC6d02B6vRN2cAJ aN/ZYxe1jE8cThRFhconI3ojo5UFk1M7sWJKsetRnM3OpbxWwpp2YhLrf040n12nG0iy rxMv6vQFAHur504SfF3CfDnEhxMYCI9z2yTBqTnTBFBMbVP62Uh7V3ZPV77W0aTMnjNe joKw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=ow05SvDekhsoivWYR83qLMTqdCpS3/JbCD21PeQAvN8=; b=mdx9qFbz4ANsnqgx0zNADrEadPfLZj1ZNZqDDxiybVTk9SFkfliMbtx2OqvGqVcM3b jVJSEtW9ZFr6cNJ4RZUQmAFpRvCqbZlAkTyUPOJn2XehmsXQCombPa2jnIEgoG0xPCM8 1fv+F0YQjwIphNZ+lLZvt1jImTVnQTr+FdthIT49N53IDrS8b4nd1Icfx4mabuHcLhE0 0ZckhBNwtpIKAZ78/XB5RqTWk870B7DP0H8C9TukU3n1TdVOfIve6DmgHr4fsrumZ7Ft WsnOtUVPAzyspQIrZOzsJfDVKBjG+Iy75cUxZMMPIHLhlWqnYmCWAQXWjjiT0++xcepH bSsw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l80-v6si8977798pfj.188.2018.06.15.17.50.41; Fri, 15 Jun 2018 17:50:56 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966153AbeFPAuS (ORCPT + 99 others); Fri, 15 Jun 2018 20:50:18 -0400 Received: from mga01.intel.com ([192.55.52.88]:36239 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966064AbeFPAuP (ORCPT ); Fri, 15 Jun 2018 20:50:15 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jun 2018 17:50:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,228,1526367600"; d="scan'208";a="47484953" Received: from yjin15-mobl.ccr.corp.intel.com (HELO [10.254.214.4]) ([10.254.214.4]) by fmsmga007.fm.intel.com with ESMTP; 15 Jun 2018 17:50:12 -0700 Subject: Re: [PATCH v1 0/2] perf: Drop leaked kernel samples To: robert@ocallahan.org, Kyle Huey Cc: acme@kernel.org, jolsa@kernel.org, "Peter Zijlstra (Intel)" , Ingo Molnar , Alexander Shishkin , open list , Vince Weaver , Will Deacon , Stephane Eranian , Namhyung Kim , ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com References: <1529057003-2212-1-git-send-email-yao.jin@linux.intel.com> <1a442b37-7a97-86f0-11e3-58d940ecfbc9@linux.intel.com> From: "Jin, Yao" Message-ID: <9b3259e8-1d07-adb1-a57c-8b276c133aa6@linux.intel.com> Date: Sat, 16 Jun 2018 08:50:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All, This patch raised many questions, I was prepared. :) I'd like to try another proposal that it adds a special flag in the returned perf_sample_data to indicate the perf binary that this sample is a leaked sample. For example, create a new PERF_SAMPLE_RETURN_LEAKAGE in perf_event_sample_format. In perf_prepare_sample(), if (event->attr.exclude_kernel && !user_mode(regs)) data->type |= PERF_SAMPLE_RETURN_LEAKAGE; Now all the samples are kept and the leaked kernel samples are tagged with PERF_SAMPLE_RETURN_LEAKAGE. In perf binary, it filters out the samples with PERF_SAMPLE_RETURN_LEAKAGE. It needs perf binary modification but rr doesn't need to be changed. I don't 0-stuffing some fields because: 1. Keeping the skid info should allow us to look at that if we have interesting later. 2. Not sure if 0-stuffing some fields has potential conflicts with some applications. Is this proposal reasonable? Thanks Jin Yao On 6/16/2018 1:34 AM, Robert O'Callahan wrote: > On Fri, Jun 15, 2018 at 10:16 AM, Kyle Huey wrote: >> >> If you want a sysctl for your own reasons that's fine. But we don't >> want a sysctl. We want to work without any further configuration. > > Also toggling a sysctl would require root privileges, but rr does not > currently need to run as root. Thus rr users would have to either > permanently change their system configuration (and every extra > configuration step is a pain), or run rr as root so rr can toggle the > sysctl itself. Running rr as root is highly undesirable. > > Rob >