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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A88A1C433F5 for ; Fri, 27 May 2022 14:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Qd+J2BkLf+x33hIOiXcxC+5T7VKg95yHL6M7AlPgcjY=; b=Zc3d/SirLdp+Gx qIvgWoVW2DowepwbipMrGlmUH84CB/KQQcyyiYdZ6aemJqsQRFI1G3cfg0+es9O6p6/FWGWnEtth/ hpbPRlHtbJQHZPP4Pb45NDooq9r+vtCDNcKe/mZpJRIhUIBuv+0KxbTxP3OTBHCx44i3NQ/fua2+d 5Jjs1xmXXa1jECIZjVAyAsunG+AleyYr+TDFLcEfnOokuHfrG1yqencvZOA8zAuY4NYuMppD4NfxV Prb73SLclXrHo75LjiJS9sXbY+8CA+cc+8IaASBFmngoTbvA8gOmVGZ2DEPv8llDUvMnXm7C0hAS7 jARmgbzpzm//GvaCcd2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nuajH-000DrC-8E; Fri, 27 May 2022 14:14:15 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nuajD-000Dox-U7 for linux-arm-kernel@lists.infradead.org; Fri, 27 May 2022 14:14:13 +0000 Received: by mail-ej1-x62e.google.com with SMTP id q21so9098414ejm.1 for ; Fri, 27 May 2022 07:14:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mDpmMrX6ZAj99tYsLUoYw7iDnZGlJpEI/3VF/4/WHsM=; b=hmiV/2279z7xlKaFk+GxCbmDFupUyDQeF53CqctYwc3ylvA1+g67fm9AYwf3aJD52U 2Y0VNqCIPfJbF0YC3jT9aXfuCTHrZQH0zxRrdU5jcN1U1Kr3Xyjgnel+Kg8sZAH6ee2U 0dRC/R9cIcfp4pxd3fmznfBJMykLh8g3O16PpM3SZgOtK4GcYkW2MzmtU5DshhyBsBBf 3dKOBekLlhYbIn1nXTFG8IGd4yeaLAs2b4LMzjf8mjbboq9RHjfL3e/PH9gzng8YZQoR wqBZqmfZxrzbCTzS+9/EGH3SBeLUcCO/TOjFgUVkrnmnGi4VHBCbnbAcC3eLlGOH/cDk d4rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mDpmMrX6ZAj99tYsLUoYw7iDnZGlJpEI/3VF/4/WHsM=; b=zBlChiKEF4tJc+5ugaojCiLOpgkNvSzjBfPYzKIH09R3HfBurYb39VMVX7YfVcj8ye 2b0tsYQl956b8aVGues0Zp4J0CPdUUfTmaZR2xlL0uv+dwZI0JQ+1GWH/CEFuPZ8lWfF Ithsgxr0UeK2cOfOlYCPftty55Ac2q+uPPaZ4gIkaTBvwzttgYRzUzZDtaww9+4Akw4X 4MSK8BFBuie2K4+Oy6mCOxcxHXXuByaY5gKN15DUJgYAbMTQ3/CnoUp9ViQ7+j2xNRIK fH0B8Lk2sQJWne4zdBYKldkjWu5cuAIA6stxhXPQzZRrto5qujAwqhXy+4FZe2mKXF0w md6A== X-Gm-Message-State: AOAM5330lUcJTtHay+l8fu2FesKK6imdmOjU/+rrQPW+l43glvv65wej KLbXu0WZl4RRqNhSDMTX6lz+eO3RpeAQCDerTCE= X-Google-Smtp-Source: ABdhPJzu+h5wDUX4t7z5kJNxgp3+mHRNUPXxSn4d+Qux7XVdKfp9P59rjLYvyQHCXOcEAGyObqTC+BjeidAUXP/vTKc= X-Received: by 2002:a17:907:7da5:b0:6fe:d818:ee49 with SMTP id oz37-20020a1709077da500b006fed818ee49mr24958685ejc.58.1653660847121; Fri, 27 May 2022 07:14:07 -0700 (PDT) MIME-Version: 1.0 References: <20220527110959.54559-1-zhangyuchen.lcr@bytedance.com> In-Reply-To: <20220527110959.54559-1-zhangyuchen.lcr@bytedance.com> From: Alexei Starovoitov Date: Fri, 27 May 2022 07:13:54 -0700 Message-ID: Subject: Re: [PATCH] procfs: add syscall statistics To: Zhang Yuchen Cc: Andrew Morton , David Hildenbrand , Peter Zijlstra , Ingo Molnar , Alexei Starovoitov , LKML , Linux-Fsdevel , "open list:DOCUMENTATION" , linux-arm-kernel , linux-s390 , Linux API , fam.zheng@bytedance.com, bpf X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220527_071412_009535_0EF9CD10 X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 27, 2022 at 4:10 AM Zhang Yuchen wrote: > > Add /proc/syscalls to display percpu syscall count. I second Peter's nack. We don't add debug features to the production kernel. > We need a less resource-intensive way to count syscall per cpu > for system problem location. > > There is a similar utility syscount in the BCC project, but syscount > has a high performance cost. There are two syscount tools in BCC: tools/syscount libbpf-tools/syscount Which one has this 42% overhead? The former tool is obsolete though. It was written in the days when bpf had 1/10 of the features it has today. Both tools can be optimized. They attach to raw_syscalls tracepoint. tracepoints are not cheap. In terms of overhead: tracepoint > raw_tracepoint > fentry. bpf can attach to all three. Please profile libbpf-tools/syscount tool with perf and unixbench, understand where overhead comes from and then optimize the tool. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel