Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4443469pxt; Wed, 11 Aug 2021 06:17:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4yRPQzB8aa/QPgXI1ALsIr3jli2zXZc9JiCTn98jWdYzJ8VfaAqRnzMdzSeYctxIKIinD X-Received: by 2002:a05:6512:318d:: with SMTP id i13mr26632240lfe.627.1628687841759; Wed, 11 Aug 2021 06:17:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628687841; cv=none; d=google.com; s=arc-20160816; b=S0Ijtzj3YTlK0JuWNuHOdMYxn9QFD6HBvXIEJBy/AIr/ct3C7oFXaAnJ8e9AZhoRNT QqRpigpm2YkAweRG1ceEvI6CiwlsAFoGQEkQZUHVjpPQ6sA5IbubeKWhZ62Rp3ekeX6c ECmyWL/nbQgnG9uo9YGgjqtt5hBLoqjYIhUwaqQ0XAoDpzXmKLFxzvINlYMAAQbzOq9O +fWUCdpzqCdH9E+2A3lbU9XeM9vOmxVLwED3Ibtnm4lpjZuOYRzrsP0x5Wo5JwwtX84F 8qthu0RphoY7oub9jmBm5863UuBk0qPFbcd6CLSdxtvITkvQSMY5Yyw6MJsJamo6c6kL d/cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=lUfr07W2Facy3cosTN1UuloK7BQI7fxBzNpE0tKGNs4=; b=Pvk+zu0KEqIByc1ZIfLbn3SYZKC7hTxAfoD6PfluqXgMvP6RQsXieiOosSjvNZIS9m mY5VormxGqaBeG0C2SOGEtYlQEvvlxFpuvlkY+z4MIPdJBzDTfemZBXO4XkKTRSPo/9+ JGEvR/rKEym2I2AH4EsPggcMDmqNiHk4lOfQ8m/w9VS64mJ/45jnfMzYqW77VLoPE3nc FdqoBF+gRxxHB2OfSDaAM/vTNOLgmzVWFPbpTmTrnCS76uMujC05lYksp3CQBtl3eHbU uP5K4dTRWlnAq68RfnvH+yEwEjoU42ODVq04xP5Qw+cAHIOCj37mpBe20j8ybdZzImcC OqMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id by8si8605568ejb.590.2021.08.11.06.16.57; Wed, 11 Aug 2021 06:17:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230170AbhHKNMu (ORCPT + 99 others); Wed, 11 Aug 2021 09:12:50 -0400 Received: from mga14.intel.com ([192.55.52.115]:39982 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231215AbhHKNMg (ORCPT ); Wed, 11 Aug 2021 09:12:36 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10072"; a="214851112" X-IronPort-AV: E=Sophos;i="5.84,313,1620716400"; d="scan'208";a="214851112" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2021 06:12:05 -0700 X-IronPort-AV: E=Sophos;i="5.84,313,1620716400"; d="scan'208";a="469395453" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.209.58.25]) ([10.209.58.25]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2021 06:12:05 -0700 Subject: Re: [RFC] perf/core: Add an ioctl to get a number of lost samples To: Namhyung Kim , Peter Zijlstra Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Jiri Olsa , Mark Rutland , Alexander Shishkin , LKML , Stephane Eranian , Ian Rogers , gmx@google.com References: <20210811062135.1332927-1-namhyung@kernel.org> From: Andi Kleen Message-ID: Date: Wed, 11 Aug 2021 06:12:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210811062135.1332927-1-namhyung@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h > index f5a6a2f069ed..44d72079c77a 100644 > --- a/include/linux/perf_event.h > +++ b/include/linux/perf_event.h > @@ -756,6 +756,8 @@ struct perf_event { > struct pid_namespace *ns; > u64 id; > > + atomic_t lost_samples; Would rather use atomic64_t. atomic_t might wrap too quickly. But it might be better to put it somewhere where you already have a lock on the event, then you wouldn't need an atomic. -Andi