Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2265007ybc; Wed, 13 Nov 2019 11:32:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyKXqd7dmA7WwRI/Waq5ggnk4UlYAO2zTeys2J+Kv0CCev8VrcSnY6mWfg5X545K9tomD2Q X-Received: by 2002:a17:907:216e:: with SMTP id rl14mr4584189ejb.291.1573673543463; Wed, 13 Nov 2019 11:32:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573673543; cv=none; d=google.com; s=arc-20160816; b=Hhe+q7QuzHcIYhlQno2MswnY7Co4sqLOCC2XnDJLVD77vkZf4CNxUFWhyC+EL+br7K p0iBGjxpqQxQjrrZ0rCQrmV6utjmEVG/ib1n52yiV/RPbg3IF18OqipRny/2Kmq8yODd nkS0/qCHWOR/YFq2XtnyaeAMIk4EfDTQThNU3a3sP43CO+VJUS6VoYPvDFOkDE8QFk14 NgxlaOPlNPcBHc23TD3vFa7jZqewPzHev4a36WAEGcApZyrcUOr7qvFmTyvnazxXD3sf QPi5vWpam6jHApMhv3HpNXQZQziFWg4su3O7P0+fD1qQmPwfMz7LICBngWy+xw8VfGri GYLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=SrLnAVX7GU+BxBx8r5w3TD8ADO1ATWwcHaHjEVGVmTI=; b=KtZVAErnb34ndOPcu8bmgSogi5iiYehDaPGpWmZpfDhzf/jCDSX7lSn+s0HiLm1yPn kGIuzP0X7L+cTOqvHLekNvRj6HmPYfGeHZO13hk268uaRT32QYBwJZPLZ46giacu4wQd qYb2jgG80/E6HicsMNuzqzWO6MGX+7CBe7v25BjGWH+TP0ovkmMkh3J2CLOyRNVyZ545 dPIhMDaMtBr0q4D01BQznUnjQ2J8ZQTQUPRnj+H/+yXhgzJmGi0ycWQW4IbEGthu+Gsb hM921QvNDrDe31fVIPmByKV3mbrtNipH65jZ8cG9GJBjaYjX6np2mZUkgU8SvrX+PZih MO5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ck15si1851763ejb.358.2019.11.13.11.31.57; Wed, 13 Nov 2019 11:32:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727097AbfKMTZC (ORCPT + 99 others); Wed, 13 Nov 2019 14:25:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:41500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726443AbfKMTZC (ORCPT ); Wed, 13 Nov 2019 14:25:02 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41358206D5; Wed, 13 Nov 2019 19:25:02 +0000 (UTC) Date: Wed, 13 Nov 2019 14:24:59 -0500 From: Steven Rostedt To: Hassan Naveed Cc: Ingo Molnar , "linux-kernel@vger.kernel.org" , Paul Burton Subject: Re: [PATCH] TRACING: FTRACE: Use xarray structure for ftrace syscalls Message-ID: <20191113142459.402b3241@gandalf.local.home> In-Reply-To: <20191022174551.2fcc85fd@gandalf.local.home> References: <20191022182303.14829-1-hnaveed@wavecomp.com> <20191022155104.29b062a5@gandalf.local.home> <20191022174551.2fcc85fd@gandalf.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ping? -- Steve On Tue, 22 Oct 2019 17:45:51 -0400 Steven Rostedt wrote: > On Tue, 22 Oct 2019 15:51:04 -0400 > Steven Rostedt wrote: > > > > static struct syscall_metadata *syscall_nr_to_meta(int nr) > > > { > > > - if (!syscalls_metadata || nr >= NR_syscalls || nr < 0) > > > - return NULL; > > > - > > > - return syscalls_metadata[nr]; > > > + return xa_load(&syscalls_metadata, (unsigned long)nr); > > > } > > > > > There appears to be a slight overhead to this for archs that do not > have a sparse syscall array. I wonder if we should make this only > applicable for archs (via adding a HAVE_SPARSE_SYSCALL_NR define and > checking against it). Then if an arch doesn't have a sparse array of > system calls, it uses a normal lookup, but for archs that do, it can > define this for this type of lookup. > > There's not much to this patch, so it wouldn't be too difficult to > support both methods. > > Without this patch I ran: > > # trace-cmd start -e syscalls > # /work/c/hackbench 50 > Time: 15.702 > # /work/c/hackbench 50 > Time: 15.932 > # /work/c/hackbench 50 > Time: 15.893 > # /work/c/hackbench 50 > Time: 16.038 > # /work/c/hackbench 50 > Time: 15.429 > > > With the patch it had: > > # trace-cmd start -e syscalls > # /work/c/hackbench 50 > Time: 16.582 > # /work/c/hackbench 50 > Time: 15.972 > # /work/c/hackbench 50 > Time: 16.078 > # /work/c/hackbench 50 > Time: 16.133 > # /work/c/hackbench 50 > Time: 16.263 > > -- Steve