Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1449946imm; Fri, 15 Jun 2018 18:18:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJNjbnLv6fiA19QBysizthi/ubf92reR4xow2GR0iZKxV3lsEUg6bwaP1bxgPveh1jC4yia X-Received: by 2002:a63:bd51:: with SMTP id d17-v6mr3738139pgp.42.1529111928800; Fri, 15 Jun 2018 18:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529111928; cv=none; d=google.com; s=arc-20160816; b=0t+kLXnI2rxehddo8vEDGyhNJqReipdbogQOh5apEPdoCN43Gy1s6DaOvNftmphA5t z/0pBjF8kJ7xPJOcJdxS/0ZsXQHa7q09RXi3cmOC09YHk+vJAxEltBi+V7C9uM1aJYV4 YQveIQP2C91CjUvFmjOE3auoDgiqv/xKoGWOk53WRHlIjnkjydneYp0FgGJpvbMhNiol dpeMCLyV7YtoTgDs+5YmcQmgpfXwvkiwmBt5zevARvG6vv1tE9/biIGqRHze4WG9TnzY WSSoMS3/Ytf+ZSpeWvTnhwZ3apwW0eUcSyMcd+5WldKxS+J7gGrC+jQoAueRbqqBGFGN XOdg== 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=LUsx/w8/3Sk8t7HqNQsEv6zquw0TpEZvFB37C4GXKS8=; b=Nt74JjMug5xNf1zflZBVlowX4TArgynP/GA6kLxciySNrg3q9J7K74X+LLt2uzPbjl JbO5nPyHvKQULJ5Q0pzYRqc24yKISYNbGlE8165Tijj3v3jHiqmZ0FS1YoegmiIFB3jU 9v8iUxcv83apka0Rg/b+tuYvudj07IrxE54VFfpaCuvJn04rZeWt3N5kTKiU9iqrYoE/ K4VEQGzGJp1lR8YH5mj5JKn6MzngLm369L+3fI0f4ReoBhuIgOzaYintdu7nN1/Vb2Tp gCnSXjOjYbczZjvGGeMyIcezK/7XSWRlj3fEAq2FwDFxqYvF/p/pGAruBYWLgwYis30P Kw1Q== 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 g19-v6si7554455pgv.127.2018.06.15.18.18.32; Fri, 15 Jun 2018 18:18:48 -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 S1756169AbeFPBSJ (ORCPT + 99 others); Fri, 15 Jun 2018 21:18:09 -0400 Received: from mga18.intel.com ([134.134.136.126]:14712 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753735AbeFPBSI (ORCPT ); Fri, 15 Jun 2018 21:18:08 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jun 2018 18:18:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,228,1526367600"; d="scan'208";a="57730774" Received: from yjin15-mobl.ccr.corp.intel.com (HELO [10.254.214.4]) ([10.254.214.4]) by FMSMGA003.fm.intel.com with ESMTP; 15 Jun 2018 18:18:04 -0700 Subject: Re: [PATCH v1 0/2] perf: Drop leaked kernel samples To: Kyle Huey Cc: Robert O'Callahan , 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> <9b3259e8-1d07-adb1-a57c-8b276c133aa6@linux.intel.com> From: "Jin, Yao" Message-ID: <3a5dba68-699d-98d0-37fc-4e7b91a86677@linux.intel.com> Date: Sat, 16 Jun 2018 09:18:04 +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 On 6/16/2018 8:56 AM, Kyle Huey wrote: > On Fri, Jun 15, 2018 at 5:50 PM, Jin, Yao wrote: >> 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 >>> >> > > If the problem you're trying to fix is an inappropriate disclosure of > kernel-space information to user-space, how does filtering the samples > in user space solve anything? > > - Kyle > In theory it is. But actually we just use perf tool to look at the sampling result. And suppose a case, if we want to estimate the skid window, we still need the skid info. Thanks Jin Yao