From patchwork Fri Feb 23 16:58:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Sverdlin X-Patchwork-Id: 10238413 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 023D960225 for ; Fri, 23 Feb 2018 17:01:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6CAA29803 for ; Fri, 23 Feb 2018 17:01:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB37D29806; Fri, 23 Feb 2018 17:01:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18E9729803 for ; Fri, 23 Feb 2018 17:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4mQXSa3bfAlFfC6IOAW8ZL6zeiFRs36Yq10zGUIzbzk=; b=YBNtv9f1EvCKqF /u8o1SRcTXp4cyvU3bIcD2WGYhMXjIVSgxF5pz9+SW31W4jHlLvyc5dTVANpBajUrwmHROctTNrmI QxbJR1yjnMoWC89x8+Id21fIDXiWJaVMzeEldEavViGmPsH/KPrSs66tkH84qH5s0iAdA6793uB0I sXEZD+2qa5i8aImxHm7lByEKsz/EwdotmW+DcQ8tGZFeilIqIbkKQuOOWslCL/vVCOPD9effsgp+i J+o0ZjHfNIif37kXxgXKtJj1UEskPrX8vadPHZgxruNoC6AvFmRBx65xqikhdrPLWIXXvsE2L1MX9 lZrVJCWjboQbCoBOZoEg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1epGiV-0001SG-09; Fri, 23 Feb 2018 17:01:03 +0000 Received: from mail-eopbgr30097.outbound.protection.outlook.com ([40.107.3.97] helo=EUR03-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1epGhm-0008JQ-Od for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2018 17:00:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=CEy1tkRVP1JWRvDZlvQcNcaRFyQ16n9dlt55kwQwios=; b=eU0xS/dfTb2slFWbcZmcWcL0KaAjrNgc75VfZC+cJ3R/vGIC9C5xZW6WETHaLpJlO+fU0QY/P4YR+1V21JdG3i9bVtOK/vQe6TBHXFiBnh8knd0hWgxzDR80GrBTGq+U4O4s9qU0udSOVXK+shSXUL9n1VlhWN8+I66J8KFCYac= Received: from ulegcpsvdell.emea.nsn-net.net (131.228.2.20) by AM4PR07MB1316.eurprd07.prod.outlook.com (2a01:111:e400:59ec::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.548.6; Fri, 23 Feb 2018 16:59:59 +0000 From: Alexander Sverdlin To: Steven Rostedt , Ingo Molnar , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] ftrace: Add module to ftrace_make_call() parameters Date: Fri, 23 Feb 2018 17:58:47 +0100 Message-Id: <20180223165849.16388-2-alexander.sverdlin@nokia.com> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20180223165849.16388-1-alexander.sverdlin@nokia.com> References: <20180223165849.16388-1-alexander.sverdlin@nokia.com> MIME-Version: 1.0 X-Originating-IP: [131.228.2.20] X-ClientProxiedBy: VI1PR0202CA0036.eurprd02.prod.outlook.com (2603:10a6:803:14::49) To AM4PR07MB1316.eurprd07.prod.outlook.com (2a01:111:e400:59ec::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a7422511-d0ff-4381-3814-08d57adee232 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7193020); SRVR:AM4PR07MB1316; X-Microsoft-Exchange-Diagnostics: 1; AM4PR07MB1316; 3:LEmSDZ1abEfjPHTLN+JYcMS/OhJoOa9vA+Vnas9tdQYyuHyFYtXe7YzMvgq+HhLtrwZ1opalBhIDzjwOtpLLk/OsAoaQ1XOP6k7ebSDXJ2n8vu3T/yTdqMn8TkhFNgqh7VT1lpAU3eahQ27kLyun5jFguFypdLoYqRgZOXzmXeQTfSrTqB141imqVEYuEZyL1yotOFqkysd+96VWdDThbXZV1kgD4GAu62TdsSH/RK3ngGRzvSPX9jWuSslMLnoL; 25:EjC2kanqYdFzGsnTwts09IGj0jZG4nly4hiLmwCOwec9bG1NGSx+JaNle3smFxYEjMBNngaOHlfskondf3+PkrT2+MHOBCQtDlJkFDjuRXNKuj9DHICpv2eYXsqZ9cUYYeP/XFA9Pz9lN0XnTxpV5Oz3pqe/L48bIBmApAdwapdOfF39wSrYeo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h4BBQ3c2PF/ITHhIXSOE=; 4:xls9ochS3fb9m3ISYV6IWGekQ5F7Uto4U1Izkb8wY3iYWMdadbxFsztKD4Rm3B5eZpSVrOrEQY3bLeylTrilK33Pu82Ha5VUKIh82XxqPRTQBnzQIL5y7MrsGGgYEsyNYk9575N6T3WL5+qG7/deqj2RRDjGHqg58xQV/tDckrvMxuAwph0Ym3zalqTZbctnKXv8oyElhbrzsZx11JslGJulvtP0LoMdwqjBFpfdS0osUylHp2x+gAfl3/EjfinexT0l8+mk0xWu6gSPnHm5uRxWhlaO+cNBwzukbAr4cwq4Tn/YgblU7WefopOYNLOe X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231192)(11241501184)(806099)(944501161)(52105095)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011); SRVR:AM4PR07MB1316; BCL:0; PCL:0; RULEID:; SRVR:AM4PR07MB1316; X-Forefront-PRVS: 0592A9FDE6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(376002)(39860400002)(39380400002)(366004)(346002)(199004)(189003)(52116002)(6506007)(386003)(7736002)(305945005)(2950100002)(76176011)(1076002)(7406005)(7416002)(97736004)(5660300001)(6666003)(6116002)(59450400001)(39060400002)(3846002)(16526019)(186003)(50226002)(105586002)(478600001)(106356001)(81166006)(81156014)(66066001)(6346003)(8936002)(47776003)(68736007)(26005)(8676002)(86362001)(50466002)(4326008)(53936002)(51416003)(25786009)(6486002)(48376002)(54906003)(110136005)(16586007)(6512007)(316002)(2906002)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:AM4PR07MB1316; H:ulegcpsvdell.emea.nsn-net.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nokia.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=alexander.sverdlin@nokia.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR07MB1316; 23:WUXkvlSFIteBK8M3r323conbNDTtSv7vyfh0+cXpD?= =?us-ascii?Q?qwAqTPJbQ0B4T2rls9RCsG7W5nXBrkpStybJjWW4wwLJ1dxvAAK2fAPWRKrI?= =?us-ascii?Q?S/2V4NxEghqoYgWlqKJ9hfqqBknlsQAYffv0gTxMC8sPUkVpuXA+rkZpWS+J?= =?us-ascii?Q?WxfJG+eYTnm+2gvl7OpXcu/RTGdD5myAySKbZfHsVVcFWj0XFCkn3GevXT+j?= =?us-ascii?Q?mJKXTz+F18a85GbwgH0NTMMwrQd+9srCeNmUUrl21QalIFXiz5G68YbsPB1p?= =?us-ascii?Q?ves5EF7fe3VFT4VvJ1UXNZqTkqkGVeYlHSEjlRLC+WNoVkxb3ASnlkG2VVyc?= =?us-ascii?Q?eG6Hq0ajcfAqUArQSAhrCeCldJiNogQDf1RezNGp/wzBM7H4jwWjp+Ly+ULi?= =?us-ascii?Q?ZgQ1DDTky0FEhcqdrenWJw1r+d4SL1wD4set6Fe9McXBBnBPr19ayhtVnhMn?= =?us-ascii?Q?LI7Xuk0JMMbY1NwPp2Oz49hbDTRdESWx0ml3vcp60b7b0H/i6n5OnLS8+qLC?= =?us-ascii?Q?JN2sP4wZHmdgkvdR+j22P+VPKmuPfARORl+/G7Ry/T5XuYdPo8Kl1FuMKMwo?= =?us-ascii?Q?g4cd4m8XBBmLuRYwAFZhjDAUocy+FtqDPVwBUDxsuhPQstBtH/wuk3gQ+l0S?= =?us-ascii?Q?4ZgkFVO3TpRLQ5L0VrB5Aa192GBbX05x3Hf1iqRlZUnYHE0q06f/w2o4HlGZ?= =?us-ascii?Q?r8Lgl3H+vbaUuyg1lBk1D01mFFehd+E5jnficYR93V5ArE+jzm8aroJ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5yqZ7o5o1EsPDAqLoKqUqUhVR7vgVbtfPXraxbo83f774F6o4ZL/bg254bVyZsUbn0zrAIQ=; 5:YWOX0CAnBWU1X5s9CpkQefBwDNe+zq7OXQ/KSx8uHjqhgluhPsw95vz+UW9O5XO4KLdVGptw4tEQc3kF6nGB7S3HEwBfqiHG2wtjVMLruHeC06FRD2u0VjkzuNiB/5djyE97w+jVNY19rlpqGpIUNyD8i+Y3kPR/lAUmYB/KxlU=; 24:xYygtN2kfl3MPxK5ZeJ9krm9j7jeAPE1xlNL8pEPMvxVXMCp1k8SUsUWCm3ZxXVTtL2KX/NyEjZF+pWrhObn7xHOaNLuSI/iZTXYMngeOsM=; 7:hfvXXtPYafU8UAwVTobwgCQaqgY+Pj9ppDFIDaOp4ZpiUtQ/tp5TbJuhHOb/0UGYvUkNSbScnJlzwWBYL+CmLTZGfqk2Kd5HqQUD5bHoUTIyS9mJ0GQ2sQdQABjOO9X1IUETjj2418rhCwUw1Nyk2xD2YJT2/JhP6IJ4/YBPfvG8q+UAP3Uygp/Ar2ithxMzBqdkgmPZffisBtd888YH/AusgYulpYQkG0IZwY/tSxWte7tNW1+9XoYSzvUcqIXs SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2018 16:59:59.8059 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7422511-d0ff-4381-3814-08d57adee232 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR07MB1316 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180223_090018_970189_01D87836 X-CRM114-Status: GOOD ( 12.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mips@linux-mips.org, Rich Felker , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Benjamin Herrenschmidt , Heiko Carstens , Paul Mackerras , "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-s390@vger.kernel.org, Yoshinori Sato , Michael Ellerman , x86@kernel.org, Russell King , Catalin Marinas , James Hogan , Fenghua Yu , Chris Metcalf , Steven Miao , Will Deacon , adi-buildroot-devel@lists.sourceforge.net, Alexander Sverdlin , Thomas Gleixner , linux-metag@vger.kernel.org, Michal Simek , Tony Luck , Ralf Baechle , Martin Schwidefsky , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP ARM support for modules' PLTs will require a module pointer in ftrace_make_call() exactly as ftrace_make_nop() has it. Change the function signature without functional change for now. Signed-off-by: Alexander Sverdlin --- arch/arm/kernel/ftrace.c | 3 ++- arch/arm64/kernel/ftrace.c | 3 ++- arch/blackfin/kernel/ftrace.c | 3 ++- arch/ia64/kernel/ftrace.c | 3 ++- arch/metag/kernel/ftrace.c | 3 ++- arch/microblaze/kernel/ftrace.c | 3 ++- arch/mips/kernel/ftrace.c | 3 ++- arch/powerpc/kernel/trace/ftrace.c | 3 ++- arch/s390/kernel/ftrace.c | 3 ++- arch/sh/kernel/ftrace.c | 3 ++- arch/sparc/kernel/ftrace.c | 3 ++- arch/tile/kernel/ftrace.c | 3 ++- arch/x86/kernel/ftrace.c | 3 ++- include/linux/ftrace.h | 4 +++- kernel/trace/ftrace.c | 6 +++--- 15 files changed, 32 insertions(+), 17 deletions(-) diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c index 5617932..be20adc 100644 --- a/arch/arm/kernel/ftrace.c +++ b/arch/arm/kernel/ftrace.c @@ -162,7 +162,8 @@ int ftrace_update_ftrace_func(ftrace_func_t func) return ret; } -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { unsigned long new, old; unsigned long ip = rec->ip; diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c index 50986e3..e3a95d3 100644 --- a/arch/arm64/kernel/ftrace.c +++ b/arch/arm64/kernel/ftrace.c @@ -68,7 +68,8 @@ int ftrace_update_ftrace_func(ftrace_func_t func) /* * Turn on the call to ftrace_caller() in instrumented function */ -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { unsigned long pc = rec->ip; u32 old, new; diff --git a/arch/blackfin/kernel/ftrace.c b/arch/blackfin/kernel/ftrace.c index 8dad758..61ffc99 100644 --- a/arch/blackfin/kernel/ftrace.c +++ b/arch/blackfin/kernel/ftrace.c @@ -45,7 +45,8 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, return ftrace_modify_code(rec->ip, mnop, sizeof(mnop)); } -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { /* Restore the mcount call site */ unsigned char call[8]; diff --git a/arch/ia64/kernel/ftrace.c b/arch/ia64/kernel/ftrace.c index cee411e..658a011 100644 --- a/arch/ia64/kernel/ftrace.c +++ b/arch/ia64/kernel/ftrace.c @@ -169,7 +169,8 @@ int ftrace_make_nop(struct module *mod, return ftrace_modify_code(rec->ip, NULL, new, 0); } -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { unsigned long ip = rec->ip; unsigned char *old, *new; diff --git a/arch/metag/kernel/ftrace.c b/arch/metag/kernel/ftrace.c index f7b23d3..635652a 100644 --- a/arch/metag/kernel/ftrace.c +++ b/arch/metag/kernel/ftrace.c @@ -104,7 +104,8 @@ int ftrace_make_nop(struct module *mod, return ftrace_modify_code(ip, old, new); } -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { unsigned char *new, *old; unsigned long ip = rec->ip; diff --git a/arch/microblaze/kernel/ftrace.c b/arch/microblaze/kernel/ftrace.c index d57563c..01b314a 100644 --- a/arch/microblaze/kernel/ftrace.c +++ b/arch/microblaze/kernel/ftrace.c @@ -161,7 +161,8 @@ int ftrace_make_nop(struct module *mod, } /* I believe that first is called ftrace_make_nop before this function */ -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { int ret; pr_debug("%s: addr:0x%x, rec->ip: 0x%x, imm:0x%x\n", diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c index 7f3dfdb..9dcec19 100644 --- a/arch/mips/kernel/ftrace.c +++ b/arch/mips/kernel/ftrace.c @@ -200,7 +200,8 @@ int ftrace_make_nop(struct module *mod, #endif } -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { unsigned int new; unsigned long ip = rec->ip; diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index 4741fe1..b198433 100644 --- a/arch/powerpc/kernel/trace/ftrace.c +++ b/arch/powerpc/kernel/trace/ftrace.c @@ -437,7 +437,8 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) #endif /* CONFIG_PPC64 */ #endif /* CONFIG_MODULES */ -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { unsigned long ip = rec->ip; unsigned int old, new; diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c index dc76d81..1691d53 100644 --- a/arch/s390/kernel/ftrace.c +++ b/arch/s390/kernel/ftrace.c @@ -136,7 +136,8 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, return 0; } -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { struct ftrace_insn orig, new, old; diff --git a/arch/sh/kernel/ftrace.c b/arch/sh/kernel/ftrace.c index 96dd9f7..2d3cacd 100644 --- a/arch/sh/kernel/ftrace.c +++ b/arch/sh/kernel/ftrace.c @@ -242,7 +242,8 @@ int ftrace_make_nop(struct module *mod, return ftrace_modify_code(rec->ip, old, new); } -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { unsigned char *new, *old; unsigned long ip = rec->ip; diff --git a/arch/sparc/kernel/ftrace.c b/arch/sparc/kernel/ftrace.c index 915dda4..36117b5 100644 --- a/arch/sparc/kernel/ftrace.c +++ b/arch/sparc/kernel/ftrace.c @@ -63,7 +63,8 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, unsigned long ad return ftrace_modify_code(ip, old, new); } -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { unsigned long ip = rec->ip; u32 old, new; diff --git a/arch/tile/kernel/ftrace.c b/arch/tile/kernel/ftrace.c index b827a41..749e50f 100644 --- a/arch/tile/kernel/ftrace.c +++ b/arch/tile/kernel/ftrace.c @@ -136,7 +136,8 @@ int ftrace_update_ftrace_func(ftrace_func_t func) return ret; } -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { unsigned long new, old; unsigned long ip = rec->ip; diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 01ebcb6..389f15c 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c @@ -162,7 +162,8 @@ int ftrace_make_nop(struct module *mod, return -EINVAL; } -int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) +int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr) { unsigned const char *new, *old; unsigned long ip = rec->ip; diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 9c3c9a3..1e8c421 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -536,6 +536,7 @@ extern int ftrace_make_nop(struct module *mod, /** * ftrace_make_call - convert a nop call site into a call to addr + * @mod: module structure if called by module load initialization * @rec: the mcount call site record * @addr: the address that the call site should call * @@ -554,7 +555,8 @@ extern int ftrace_make_nop(struct module *mod, * -EPERM on error writing to the location * Any other value will be considered a failure. */ -extern int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr); +extern int ftrace_make_call(struct module *mod, struct dyn_ftrace *rec, + unsigned long addr); #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS /** diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index eac9ce2..d32f2f5 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -2421,7 +2421,7 @@ unsigned long ftrace_get_addr_curr(struct dyn_ftrace *rec) } static int -__ftrace_replace_code(struct dyn_ftrace *rec, int enable) +__ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int enable) { unsigned long ftrace_old_addr; unsigned long ftrace_addr; @@ -2442,7 +2442,7 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable) case FTRACE_UPDATE_MAKE_CALL: ftrace_bug_type = FTRACE_BUG_CALL; - return ftrace_make_call(rec, ftrace_addr); + return ftrace_make_call(mod, rec, ftrace_addr); case FTRACE_UPDATE_MAKE_NOP: ftrace_bug_type = FTRACE_BUG_NOP; @@ -2470,7 +2470,7 @@ void __weak ftrace_replace_code(int enable) if (rec->flags & FTRACE_FL_DISABLED) continue; - failed = __ftrace_replace_code(rec, enable); + failed = __ftrace_replace_code(NULL, rec, enable); if (failed) { ftrace_bug(failed, rec); /* Stop processing */