Reapply "exit: Remove profile_task_exit & profile_munmap"
This reverts commit 3936c80525.
Instead of maintaining this interface which has been removed upstream
let's convert the only user in Android (uid_sys_stats) to a different
callback infrastructure such as hooking into the sched_process_exit()
tracepoint.
Bug: 219790626
Cc: Tiffany Yang <ynaffit@google.com>
Cc: Neill Kapron <nkapron@google.com>
Change-Id: I830330c32829df5fca8d9363cf81b0d0efaac265
Signed-off-by: Carlos Llamas <cmllamas@google.com>
This commit is contained in:
1 parent
7a28cde1a6
commit
e6599f4436
4 files changed
-81
No files matched your search
@@ -24,11 +24,6 @@ static inline int create_proc_profile(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
enum profile_type {
|
||||
PROFILE_TASK_EXIT,
|
||||
PROFILE_MUNMAP
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PROFILING
|
||||
|
||||
extern int prof_on __read_mostly;
|
||||
@@ -59,15 +54,6 @@ static inline void profile_hit(int type, void *ip)
|
||||
struct task_struct;
|
||||
struct mm_struct;
|
||||
|
||||
/* task is in do_exit() */
|
||||
void profile_task_exit(struct task_struct * task);
|
||||
|
||||
/* sys_munmap */
|
||||
void profile_munmap(unsigned long addr);
|
||||
|
||||
int profile_event_register(enum profile_type, struct notifier_block * n);
|
||||
int profile_event_unregister(enum profile_type, struct notifier_block * n);
|
||||
|
||||
#else
|
||||
|
||||
#define prof_on 0
|
||||
@@ -92,18 +78,6 @@ static inline void profile_hit(int type, void *ip)
|
||||
return;
|
||||
}
|
||||
|
||||
static inline int profile_event_register(enum profile_type t, struct notifier_block * n)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline int profile_event_unregister(enum profile_type t, struct notifier_block * n)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
#define profile_task_exit(a) do { } while (0)
|
||||
#define profile_munmap(a) do { } while (0)
|
||||
|
||||
#endif /* CONFIG_PROFILING */
|
||||
|
||||
|
||||
@@ -901,7 +901,6 @@ void __noreturn do_exit(long code)
|
||||
WARN_ON(irqs_disabled());
|
||||
WARN_ON(tsk->plug);
|
||||
|
||||
profile_task_exit(tsk);
|
||||
kcov_task_exit(tsk);
|
||||
kmsan_task_exit(tsk);
|
||||
|
||||
|
||||
@@ -114,59 +114,6 @@ int __ref profile_init(void)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Profile event notifications */
|
||||
|
||||
static BLOCKING_NOTIFIER_HEAD(task_exit_notifier);
|
||||
static BLOCKING_NOTIFIER_HEAD(munmap_notifier);
|
||||
|
||||
void profile_task_exit(struct task_struct *task)
|
||||
{
|
||||
blocking_notifier_call_chain(&task_exit_notifier, 0, task);
|
||||
}
|
||||
|
||||
void profile_munmap(unsigned long addr)
|
||||
{
|
||||
blocking_notifier_call_chain(&munmap_notifier, 0, (void *)addr);
|
||||
}
|
||||
|
||||
int profile_event_register(enum profile_type type, struct notifier_block *n)
|
||||
{
|
||||
int err = -EINVAL;
|
||||
|
||||
switch (type) {
|
||||
case PROFILE_TASK_EXIT:
|
||||
err = blocking_notifier_chain_register(
|
||||
&task_exit_notifier, n);
|
||||
break;
|
||||
case PROFILE_MUNMAP:
|
||||
err = blocking_notifier_chain_register(
|
||||
&munmap_notifier, n);
|
||||
break;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(profile_event_register);
|
||||
|
||||
int profile_event_unregister(enum profile_type type, struct notifier_block *n)
|
||||
{
|
||||
int err = -EINVAL;
|
||||
|
||||
switch (type) {
|
||||
case PROFILE_TASK_EXIT:
|
||||
err = blocking_notifier_chain_unregister(
|
||||
&task_exit_notifier, n);
|
||||
break;
|
||||
case PROFILE_MUNMAP:
|
||||
err = blocking_notifier_chain_unregister(
|
||||
&munmap_notifier, n);
|
||||
break;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(profile_event_unregister);
|
||||
|
||||
static void do_profile_hits(int type, void *__pc, unsigned int nr_hits)
|
||||
{
|
||||
unsigned long pc;
|
||||
|
||||
Reference in new issue
Block a user