From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754876AbcH3TaA (ORCPT ); Tue, 30 Aug 2016 15:30:00 -0400 Received: from smtprelay0065.hostedemail.com ([216.40.44.65]:56650 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750855AbcH3T37 (ORCPT ); Tue, 30 Aug 2016 15:29:59 -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:1183:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3874:4605:5007:6119:6261:7875:7903:8660:10004:10400:10848:10967:11026:11232:11658:11914:12438:12663:12740:13069:13148:13161:13229:13230:13311:13357:13439:14096:14097:14181:14659:14721:21080:21212:21222:21324:30003:30012: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:4,LUA_SUMMARY:none X-HE-Tag: mice47_39c50bd0eb25a X-Filterd-Recvd-Size: 2364 Date: Tue, 30 Aug 2016 15:29:55 -0400 From: Steven Rostedt To: Andy Lutomirski Cc: Marcin Nowakowski , Linux API , Ingo Molnar , open list , Linux MIPS Mailing List Subject: Re: [PATCH 1/2] tracing/syscalls: allow multiple syscall numbers per syscall Message-ID: <20160830152955.17633511@gandalf.local.home> In-Reply-To: References: <1472463007-6469-1-git-send-email-marcin.nowakowski@imgtec.com> 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 11:52:39 -0700 Andy Lutomirski wrote: > Okay, I think I see what's going on. init_ftrace_syscalls() does: > > meta = find_syscall_meta(addr); > > Unless I'm missing some reason why this is a sensible thing to do, > this seems overcomplicated and incorrect. There is exactly one caller > of find_syscall_meta() and that caller knows the syscall number. Why > doesn't it just look up the metadata by *number* instead of by syscall > implementation address? There are plenty of architectures for which > multiple logically different syscalls can share an implementation > (e.g. pretty much everything that calls in_compat_syscall()). The problem is that the meta data is created at the syscalls themselves. Look at all the macro magic in include/linux/syscalls.h, and search for __syscall_metadata. The meta data is created via linker magic, and the find_syscall_meta() is what finds a specific system call and the meta data associated with it. Then it can use the number to system call mapping. Yes, this code needs some loving. -- Steve