Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 177fb744 authored by Sarang Joshi's avatar Sarang Joshi
Browse files

coresight: modify function names and messages



Modify function names and messages to be consistent with other
modules. Modify function names starting with control_* to
event_*, abort_control_tracing to event_trace_user_fault and
abort_tracing_undef_instr to event_trace_undef_instr.

Change-Id: Ic6101dc8024b8d10713c162ea93e268ba59eaf8a
Signed-off-by: default avatarSarang Joshi <spjoshi@codeaurora.org>
parent a435d142
Loading
Loading
Loading
Loading
+24 −26
Original line number Diff line number Diff line
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -10,9 +10,6 @@
 * GNU General Public License for more details.
 */

/*
 * DLKM to register a callback with a ftrace event
 */
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
@@ -23,49 +20,50 @@

#include <trace/events/exception.h>

static void abort_coresight_tracing(void *ignore, struct task_struct *task,\
					unsigned long addr, unsigned int fsr)
static void event_trace_user_fault(void *ignore,
				   struct task_struct *task,
				   unsigned long addr,
				   unsigned int fsr)
{
	coresight_abort();
	pr_debug("control_trace: task_name: %s, addr: %lu, fsr:%u",\
	pr_debug("coresight_event: task_name: %s, addr: %lu, fsr:%u",
		(char *)task->comm, addr, fsr);
}

static void abort_tracing_undef_instr(void *ignore, struct pt_regs *regs,\
static void event_trace_undef_instr(void *ignore,
				    struct pt_regs *regs,
				    void *pc)
{
	if (user_mode(regs)) {
		coresight_abort();
		pr_debug("control_trace: pc: %p", pc);
		pr_debug("coresight_event: pc: %p", pc);
	}
}

static int __init control_trace_init(void)
static int __init event_init(void)
{
	int ret_user_fault, ret_undef_instr;
	ret_user_fault = register_trace_user_fault(abort_coresight_tracing,\
							NULL);
	ret_undef_instr = register_trace_undef_instr(abort_tracing_undef_instr,\
							NULL);
	ret_user_fault = register_trace_user_fault(
				event_trace_user_fault, NULL);
	ret_undef_instr = register_trace_undef_instr(
				event_trace_undef_instr, NULL);
	if (ret_user_fault != 0 || ret_undef_instr != 0) {
		pr_info("control_trace: Module Not Registered\n");
		pr_info("coresight_event: Module Not Registered\n");
		return (ret_user_fault < 0 ?\
			ret_user_fault : ret_undef_instr);
	}
	pr_info("control_trace: Module Registered\n");
	pr_info("coresight_event: Module Initialized\n");
	return 0;
}
module_init(event_init);

module_init(control_trace_init);

static void __exit control_trace_exit(void)
static void __exit event_exit(void)
{
	unregister_trace_user_fault(abort_coresight_tracing, NULL);
	unregister_trace_undef_instr(abort_tracing_undef_instr, NULL);
	pr_info("control_trace: Module Removed\n");
	unregister_trace_user_fault(event_trace_user_fault, NULL);
	unregister_trace_undef_instr(event_trace_undef_instr, NULL);
	pr_info("coresight_event: Module Removed\n");
}

module_exit(control_trace_exit);
module_exit(event_exit);

MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Kernel Module to abort tracing");
MODULE_DESCRIPTION("Coresight Event driver to abort tracing");