From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAE91C4338F for ; Wed, 11 Aug 2021 13:12:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D286A60FC3 for ; Wed, 11 Aug 2021 13:12:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230518AbhHKNMv (ORCPT ); Wed, 11 Aug 2021 09:12:51 -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