Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2510154pxb; Mon, 18 Jan 2021 21:40:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbWNTFZd6rOhEAAIce3QoU1670lS5zBABY2XIeywi0Ne+kY5ELemAIM79t4UC5OdWxtjpf X-Received: by 2002:a17:906:fc3:: with SMTP id c3mr2005565ejk.474.1611034828759; Mon, 18 Jan 2021 21:40:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611034828; cv=none; d=google.com; s=arc-20160816; b=a/A2LhDs3iqXJqozbXkB+5xVOAQUvbFPkNrbOSDOs7JUUzanLCerDuyzv+Hj19D3SW 4G+1aD4dX/VHzn951Vnw+KyI1wFNF4T3QH+1HHvxYQEcQXQHo5kaKf9lWgZSfEbli6p0 5Mgf3mh/349gZX5hRmk2fEPBtvH1FAgev4NAm9g3TMH2S2PD/Nt002BZirZdW16klMdl u0I1E4Bb0mU/9BZ+JH/0vlZBLQvjRHmhUOjnZw8Hv1FjkkZNPhIUFcTcncGFeSli1/0S jZ8o/AIBKpMlyNmhnAJ8b78wNbq17PDH+SsatMzvAMvTwN3yj/d0vD1mevtltuMopDiC 64/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Ojqp2T2HIXLPkCDBKcmUSSjcF3qRybCSsd8tk+cfTS8=; b=NKYHkIpDLEK0gD1SwtMm3L6oF4SneuKOShEOAEzGCmBWeL2wFkPS0wsUJ3gR/qJ7x+ hBUOKBPOTnBn7baF9073H9+WI0sHb5NdON5kt1NetBmP8v4tWsBAgtJ+tBXl3A+TMxCu z0UhTpE/2gw4oJ8edt3bqLJMBm3KJYOANILV4PykY4ZIn68FVf7yOHFeNoQA23VS0yIW Zd1PoVxeWkO4ShMqiIvIG29HILTPSlGMV/DCC70YmDlqWWbWT1fWkXgn/9U9En5UBvTI vsS8bwR9rXigLRPn3pEO6uj7CpjtMlB7rwdItQh/S43/wiVIny/ejksA7gsBsfO+D5OW GuTg== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si1868880edk.404.2021.01.18.21.40.05; Mon, 18 Jan 2021 21:40:28 -0800 (PST) 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733065AbhASBn2 (ORCPT + 99 others); Mon, 18 Jan 2021 20:43:28 -0500 Received: from mail-lj1-f172.google.com ([209.85.208.172]:43043 "EHLO mail-lj1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729202AbhASBn1 (ORCPT ); Mon, 18 Jan 2021 20:43:27 -0500 Received: by mail-lj1-f172.google.com with SMTP id e7so20161404ljg.10 for ; Mon, 18 Jan 2021 17:43:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ojqp2T2HIXLPkCDBKcmUSSjcF3qRybCSsd8tk+cfTS8=; b=aIu0kx0Ol6rtgagJXjJzdnDPuVQfgocOANYM6x1RmelANqrOLHssiPf/rcYWmB2ATs ZV4kjZARAHlO9ZvQ0p4AH0cGlSne4P0ouE15kOhHxzxAtxkCGbyN/Zeg4VDucHgtE492 rMxIIxXnsPN3EQZqohGut1c3oDMxAIRRdSzqAocsJF69XwGf9aYde2fbJnrwDyxq0mzu xjY8fokQPaDelQe3Jy1yI3ziJU5989M/QyI50gB5wJEqjCUkqMTOT3YAOWtS1d63MKKg itBoVjmdT8QDjGrDhCh3vQni7BU3mp1gsdLYFwDcQGJsi96CRmh9m8C065lVNCskfnPw cSXQ== X-Gm-Message-State: AOAM530AmufpPV417UunOeLzlIQ7T3nNImZeK+G5DYVEwYWyStUPLzti aZN6IbxGSuIQZubpwN0njx9c6xpaN/421PYbrZM= X-Received: by 2002:a2e:b04e:: with SMTP id d14mr847246ljl.26.1611020565655; Mon, 18 Jan 2021 17:42:45 -0800 (PST) MIME-Version: 1.0 References: <20210118034323.427029-1-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Tue, 19 Jan 2021 10:42:34 +0900 Message-ID: Subject: Re: [PATCH] perf/core: Emit PERF_RECORD_LOST for pinned events To: Peter Zijlstra Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Mark Rutland , Alexander Shishkin , LKML , Stephane Eranian , Andi Kleen , Ian Rogers , Alexey Alexandrov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 9:56 PM Peter Zijlstra wrote: > > On Mon, Jan 18, 2021 at 08:44:20PM +0900, Namhyung Kim wrote: > > Hi Peter, > > > > On Mon, Jan 18, 2021 at 7:11 PM Peter Zijlstra wrote: > > > > > > On Mon, Jan 18, 2021 at 12:43:23PM +0900, Namhyung Kim wrote: > > > > As of now we silently ignore pinned events when it's failed to be > > > > scheduled and make it error state not try to schedule it again. > > > > That means we won't get any samples for the event. > > > > > > > > But there's no way for users to notice and respond to it. Let's > > > > emit a lost event with a new misc bit to indicate this situation. > > > > > > Users should get a read(2) error IIRC, does that not work? > > > > Ah, right. maybe I'm too specific to perf record's perspective. > > > > In perf record, it doesn't use read(2) so I thought it should > > have the information in the stream of sample data. > > perf-record could of course do a read() at the end, to detect this. OK, will add that. > > I don't think I object to having an even in the stream, but your LOST > event is unfortunate in that it itself can get lost when there's no > space in the buffer (which arguably is unlikely, but still). > > So from that point of view, I think overloading LOST is not so very nice > for this. But anything can get lost in case of no space. Do you want to use something other than the LOST event? Thanks, Namhyung