From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751548AbdISOfg (ORCPT ); Tue, 19 Sep 2017 10:35:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:44922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbdISOff (ORCPT ); Tue, 19 Sep 2017 10:35:35 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51E002187B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Message-Id: <20170919142801.151866799@goodmis.org> User-Agent: quilt/0.63-1 Date: Tue, 19 Sep 2017 10:28:01 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Jessica Yu , Rusty Russell Subject: [RFC][PATCH 0/5] tracing: Allow module init functions to be traced Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Last release, module functions can be enabled before they are loaded by echoing in ":mod:module-name" into set_ftrace_filter before the module is loaded. When the module is loaded, its functions will be enabled for tracing. Now it makes sense to enable module init functions as well (kernel init functions can already be traced). The first patch adds a function ftrace_free_mem() to let module code tell ftrace to free the init functions from its tables so that new enabling or disabling of function tracing does not try to modify text that no longer exists in memory. The second patch enables tracing of init functions from within modules. The third patch adds kallsyms of those init functions so they look like funtion names and not function pointers within the trace. The fourth patch frees the saved kallsym name maps of the function names to the module init addresses. The last patch has kallsyms display the module init functions. Steven Rostedt (VMware) (5): ftrace: Add a ftrace_free_mem() function for modules to use ftrace: Allow module init functions to be traced ftrace: Save module init functions kallsyms symbols for tracing ftrace: Add freeing algorithm to free ftrace_mod_maps ftrace/kallsyms: Have /proc/kallsyms show saved mod init functions ---- include/linux/ftrace.h | 26 ++++++ include/linux/init.h | 4 +- kernel/kallsyms.c | 38 +++++++-- kernel/module.c | 2 + kernel/trace/ftrace.c | 226 ++++++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 284 insertions(+), 12 deletions(-)