From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755634AbcH3WDf (ORCPT ); Tue, 30 Aug 2016 18:03:35 -0400 Received: from smtprelay0229.hostedemail.com ([216.40.44.229]:41757 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750798AbcH3WDc (ORCPT ); Tue, 30 Aug 2016 18:03:32 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::,RULES_HIT:41:355:379:541:560:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2901:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:5007:6119:6261:7875:7903:8660:9010:10004:10394:10400:10450:10455:10848:10967:11026:11232:11658:11914:12296:12663:12740:13069:13148:13161:13229:13230:13311:13357:13439:14096:14097:14181:14659:14721:19904:19999:21080:21212:21324:21433:30012:30029:30030:30034:30054:30060:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: knee40_58b62fc8aa81c X-Filterd-Recvd-Size: 3031 Date: Tue, 30 Aug 2016 18:03:28 -0400 From: Steven Rostedt To: Andy Lutomirski Cc: Linux API , Ingo Molnar , open list , Linux MIPS Mailing List , Marcin Nowakowski Subject: Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Message-ID: <20160830180328.4e579db3@gandalf.local.home> In-Reply-To: References: <1472463007-6469-1-git-send-email-marcin.nowakowski@imgtec.com> <20160830152955.17633511@gandalf.local.home> <20160830165830.5e494c43@gandalf.local.home> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Aug 2016 14:45:05 -0700 Andy Lutomirski wrote: > I wonder: could more of it be dynamically allocated? I.e. statically > generate metadata with args and name and whatever but without any nr. > Then dynamically allocate the map from nr to metadata? Any ideas on how to do that? > > > > > > > Could we at least have an array of (arch, nr) instead of just an array > > > of nrs in the metadata? > > > > I guess I'm not following you on what would be used for "arch". > > Whatever syscall_get_arch() would return for the syscall. For x86, > for example, most syscalls have a compat nr and a non-compat nr. How > does tracing currently handle that? We currently disable tracing compat syscalls. What the current code does, is that the macro and linker magic creates a list of meta data structures, that have a name attached to them. Then on boot up, we scan the list of syscall numbers and then ask the arch for the system call they represent to get the actual function itself: addr = arch_syscall_addr(i); where 'i' is the system call nr. Then the find_syscall_meta(addr) will do a ksyms_lookup to convert the addr into the system call name, and then search the meta data for one that has that name attached to it. Yes it is ugly. But we don't currently have a method to automatically match the meta data with the system call numbers. The system call macros only have access to the names and the parameters, not the numbers that are associated with them. -- Steve