Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105797
b: refs/heads/master
c: b03f648
h: refs/heads/master
i:
  105795: 32076a0
v: v3
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed Jul 25, 2008
1 parent 66a818f commit 47f2ac6
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 696adfe84c11c571a1e0863460ff0ec142b4e5a9
refs/heads/master: b03f6489f9f27dc519a4c60ebf39cc7b8a58eae7
56 changes: 39 additions & 17 deletions trunk/include/linux/profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#include <asm/errno.h>

extern int prof_on __read_mostly;

#define CPU_PROFILING 1
#define SCHED_PROFILING 2
#define SLEEP_PROFILING 3
Expand All @@ -19,14 +17,29 @@ struct proc_dir_entry;
struct pt_regs;
struct notifier_block;

#if defined(CONFIG_PROFILING) && defined(CONFIG_PROC_FS)
void create_prof_cpu_mask(struct proc_dir_entry *);
#else
#define create_prof_cpu_mask(x) do { (void)(x); } while (0)
#endif

enum profile_type {
PROFILE_TASK_EXIT,
PROFILE_MUNMAP
};

#ifdef CONFIG_PROFILING

extern int prof_on __read_mostly;

/* init basic kernel profiler */
void __init profile_init(void);
void profile_tick(int);
void profile_tick(int type);

/*
* Add multiple profiler hits to a given address:
*/
void profile_hits(int, void *ip, unsigned int nr_hits);
void profile_hits(int type, void *ip, unsigned int nr_hits);

/*
* Single profiler hit:
Expand All @@ -40,19 +53,6 @@ static inline void profile_hit(int type, void *ip)
profile_hits(type, ip, 1);
}

#ifdef CONFIG_PROC_FS
void create_prof_cpu_mask(struct proc_dir_entry *);
#else
#define create_prof_cpu_mask(x) do { (void)(x); } while (0)
#endif

enum profile_type {
PROFILE_TASK_EXIT,
PROFILE_MUNMAP
};

#ifdef CONFIG_PROFILING

struct task_struct;
struct mm_struct;

Expand Down Expand Up @@ -80,6 +80,28 @@ struct pt_regs;

#else

#define prof_on 0

static inline void profile_init(void)
{
return;
}

static inline void profile_tick(int type)
{
return;
}

static inline void profile_hits(int type, void *ip, unsigned int nr_hits)
{
return;
}

static inline void profile_hit(int type, void *ip)
{
return;
}

static inline int task_handoff_register(struct notifier_block * n)
{
return -ENOSYS;
Expand Down
3 changes: 2 additions & 1 deletion trunk/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#

obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
cpu.o exit.o itimer.o time.o softirq.o resource.o \
sysctl.o capability.o ptrace.o timer.o user.o \
signal.o sys.o kmod.o workqueue.o pid.o \
Expand All @@ -24,6 +24,7 @@ CFLAGS_REMOVE_sched_clock.o = -pg
CFLAGS_REMOVE_sched.o = -mno-spe -pg
endif

obj-$(CONFIG_PROFILING) += profile.o
obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) += sysctl_check.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o
obj-y += time/
Expand Down
4 changes: 0 additions & 4 deletions trunk/kernel/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ void __init profile_init(void)

/* Profile event notifications */

#ifdef CONFIG_PROFILING

static BLOCKING_NOTIFIER_HEAD(task_exit_notifier);
static ATOMIC_NOTIFIER_HEAD(task_free_notifier);
static BLOCKING_NOTIFIER_HEAD(munmap_notifier);
Expand Down Expand Up @@ -203,8 +201,6 @@ void unregister_timer_hook(int (*hook)(struct pt_regs *))
}
EXPORT_SYMBOL_GPL(unregister_timer_hook);

#endif /* CONFIG_PROFILING */


#ifdef CONFIG_SMP
/*
Expand Down

0 comments on commit 47f2ac6

Please sign in to comment.