Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp407076pxb; Wed, 29 Sep 2021 01:39:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzK7l9/K8RuBrfx0A+rv5Kc2t7VAS5nHASLbf55Y4c3aLksJxl0zvvcn4GTOpixiOYEHJC X-Received: by 2002:a17:906:1f81:: with SMTP id t1mr12079918ejr.510.1632904745208; Wed, 29 Sep 2021 01:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632904745; cv=none; d=google.com; s=arc-20160816; b=VVawmBA86xbmWcdlvf304vFIkiOmVLTcRcdlGTi8Hp4vT0ZQ+YB6PnFM34bRzhyED3 6ulRlaKQv7evJcASquKS3mYALBCluvtofsl4AQDoTjGch0k3yUBFqrPNq9dp1sR/sqgz nGKQRGMXDZ2SoVbpg1lamFUUuz4vUup+N2PWWRy0kStqsD7qn1s+2Rp/HpOno+wMTbox GPtGsEktqvV/MnOGmjsJAgFalQvc8YKMYNPTYrs6VFod1AZM2DYFyHOebK/jh40eLqxw 2aKAnl4KrioiUX/Yz78gP0oRYjgSyOoISzF2BnPJhB3QMFvtFcfv87Dhxwr35qlfBCoW 0cgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SV4z02fQHJKU53d8jxad0OxnLv9XTsMO9xV7N7zdQ6Y=; b=wjfimJBUe3NwNAxYgpdn96I2xivcdU5TQ94cjBxwXAP9Z7o6e7O2O+YuUeInzswA1h udvWojCtc49QzrtewMAqRNgZr34b2dmp7b82jUEpGgncMsD+8MpYEQ6HmK1cXBh5HloY YedV5zxHzC8SIdv5Z5ky41OCu09r/GBX/UK2uOPvh0JllnM8w7Tu4kxFTTGDcQflsID5 YY7020tm5E8jJZJrn1nP4TAz9NovnIj41Xl55rj993i0ZM1drxM8fhamDK6PrIzhSX7m lnLSCu8G3DvNuaSW3EY229+FXFFA6sOHbuMCtjLQO9nks/ESBirVjGOv6D+G1rKtCNWY 3q5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=rSe8TuC8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si1876437edx.527.2021.09.29.01.38.40; Wed, 29 Sep 2021 01:39:05 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=rSe8TuC8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244792AbhI2Igc (ORCPT + 99 others); Wed, 29 Sep 2021 04:36:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244789AbhI2Igb (ORCPT ); Wed, 29 Sep 2021 04:36:31 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5256BC06174E; Wed, 29 Sep 2021 01:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=SV4z02fQHJKU53d8jxad0OxnLv9XTsMO9xV7N7zdQ6Y=; b=rSe8TuC8imwfT6E1X6+WboQJLW 7k7fqZpa/U1uGtZoCJbcblrFT0JFyr7cTZW0Nch1KpeE0R432yshLdinJP7FGEW3dozL0/zimcP4V PX58V37T6BdAwrcgCZTdKoOcpO4ZCw4CoUHOSwg3CH+zmkL9aLFwFe8yBQuBVXvCe+hei0usuo3wQ P7QAsfy/Mg4H+o/6pDYa+Dz9uPy6qa4P7KnCQFid498eo1cODfprebhnqCKGiXw6arj4ekjmVjfU4 rB0ni5307qLFuCJKvxZFoG4+nkyJcSi9nC/RddFPl7QO8z3moJT26grUDEfqPwnCPwGm1+Hzl6Nk0 dX4aT1oA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVV1h-00BeBj-Of; Wed, 29 Sep 2021 08:33:31 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 9B38B30029A; Wed, 29 Sep 2021 10:33:16 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 82F9729AD1D57; Wed, 29 Sep 2021 10:33:16 +0200 (CEST) Date: Wed, 29 Sep 2021 10:33:16 +0200 From: Peter Zijlstra To: Alexander Lochmann Cc: Dmitry Vyukov , Andrey Konovalov , Jonathan Corbet , Andrew Klychkov , Miguel Ojeda , Randy Dunlap , Johannes Berg , Ingo Molnar , Greg Kroah-Hartman , Sebastian Andrzej Siewior , Jakub Kicinski , Aleksandr Nogikh , kasan-dev@googlegroups.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2] Introduced new tracing mode KCOV_MODE_UNIQUE. Message-ID: References: <20210927173348.265501-1-info@alexander-lochmann.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210927173348.265501-1-info@alexander-lochmann.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 27, 2021 at 07:33:40PM +0200, Alexander Lochmann wrote: > The existing trace mode stores PCs in execution order. This could lead > to a buffer overflow if sufficient amonut of kernel code is executed. > Thus, a user might not see all executed PCs. KCOV_MODE_UNIQUE favors > completeness over execution order. While ignoring the execution order, > it marks a PC as exectued by setting a bit representing that PC. Each > bit in the shared buffer represents every fourth byte of the text > segment. Since a call instruction on every supported architecture is > at least four bytes, it is safe to just store every fourth byte of the > text segment. I'm still trying to wake up, but why are call instruction more important than other instructions? Specifically, I'd think any branch instruction matters for coverage. More specifically, x86 can do a tail call with just 2 bytes.