Commit Graph

11 Commits

Author SHA1 Message Date
Arnaldo Carvalho de Melo 97385598a6 [CLASSES]: Use strdup for the ->name members
Reducing the memory footprint, but more has to be done, such as to take
advantage of the strings table when handling indirect strings.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-11-02 13:48:35 -03:00
Arnaldo Carvalho de Melo 683428ee16 [PFUNCT]: Add missing 'else'
And update the --help output.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-11-01 18:08:54 -03:00
Arnaldo Carvalho de Melo 800429032e [PFUNCT]: Implement --function_name_len
[acme@newtoy net-2.6]$ pfunct --function_name_len vmlinux | sort -k 2 -nr | head -5
attribute_container_add_class_device_adapter: 44
wait_for_completion_interruptible_timeout: 41
sparse_memory_present_with_active_regions: 41
attribute_container_classdev_to_container: 41
percpu_pagelist_fraction_sysctl_handler: 39
[acme@newtoy net-2.6]$

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-11-01 10:42:18 -03:00
Arnaldo Carvalho de Melo 09bb5df8aa [PFUNCT]: Implement --nr_parameters
[acme@newtoy net-2.6]$ pfunct --nr_parameters vmlinux | sort -k 2 -nr | head -5
__ide_add_setting: 13
ide_add_setting: 12
fib_dump_info: 12
__blockdev_direct_IO: 10
vma_merge: 9
[acme@newtoy net-2.6]$

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-11-01 10:34:42 -03:00
Arnaldo Carvalho de Melo 4a6117a912 [PFUNCT]: Introduce --help
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-11-01 10:29:31 -03:00
Arnaldo Carvalho de Melo eff5348081 Handle the DW_TAG_variable and DW_TAG_label tags, now we can do:
[acme@newtoy net-2.6]$ pfunct --variables vmlinux | sort -k 2 -nr | head -5
do_task_stat: 29
load_elf_binary: 28
elf_core_dump: 23
ext3_new_blocks: 21
sys_unshare: 19
[acme@newtoy net-2.6]$

And:

[acme@newtoy net-2.6]$ pfunct --goto_labels vmlinux | sort -k 2 -nr | head -5
copy_process: 16
sys_unshare: 10
device_add: 9
class_device_add: 8
tcp_sendmsg: 7
[acme@newtoy net-2.6]$

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-11-01 10:18:01 -03:00
Arnaldo Carvalho de Melo 5aaca80de6 [CLASSES]: Rework the find_by routines
So that we can find all the cus for some specific class
(cus__find_class_by_name), or traverse all the CUs (cus__for_each_cu),
etc.

Now we don't look at just the first CU in multi-CU files (vmlinux, etc).

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-10-31 17:23:16 -03:00
Arnaldo Carvalho de Melo 0ca9826e36 Introduce struct cu, i.e. a per compilation unit struct that holds the list of
types for each CU, for now when working on multi-CU files (vmlinux, any binary
with more than one object file linked) we look only at the first CU when
looking for a specific class or function name, this will be fixed in the
upcoming csets, but doesn't affect the case when we don't specify a class or
function name, where all the CU's are traversed.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-10-31 16:12:42 -03:00
Arnaldo Carvalho de Melo 8f1d76d93a [PFUNCT]: Implement --size in pfunct
[acme@newtoy net-2.6]$ pfunct --size net/ipv4/netfilter/ip_conntrack.ko | sort -k 2 -nr | head -5
tcp_packet: 3349
ip_conntrack_in: 1146
icmp_error: 874
ip_conntrack_expect_related: 804
__ip_conntrack_confirm: 586
[acme@newtoy net-2.6]$

'nuff said :-)

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-10-30 15:15:09 -03:00
Arnaldo Carvalho de Melo 3dfd363868 Add getopt support in pfunct, options implemented should be self explaining,
except for --classes, that asks that all non-inlined functions that receive as
one of its parameter a pointer to the specified class be printed, just the name
if --verbose is not used, or its complete prototype and where it is in the
source code:

[acme@newtoy net-2.6]$ pfunct --verbose --class=inode fs/ext3/built-in.o
/* /pub/scm/linux/kernel/git/acme/net-2.6/fs/ext3/balloc.c 606 */
void ext3_free_blocks(handle_t * handle, struct inode * inode, ext3_fsblk_t block, long unsigned int count);

/* /pub/scm/linux/kernel/git/acme/net-2.6/fs/ext3/balloc.c 1404 */
ext3_fsblk_t ext3_new_blocks(handle_t * handle, struct inode * inode, ext3_fsblk_t goal, long unsigned int * count, int * errp);

/* /pub/scm/linux/kernel/git/acme/net-2.6/fs/ext3/balloc.c 1668 */
ext3_fsblk_t ext3_new_block(handle_t * handle, struct inode * inode, ext3_fsblk_t goal, int * errp);

/* /pub/scm/linux/kernel/git/acme/net-2.6/fs/ext3/balloc.c 346 */
void ext3_init_block_alloc_info(struct inode * inode);

/* /pub/scm/linux/kernel/git/acme/net-2.6/fs/ext3/balloc.c 388 */
void ext3_discard_reservation(struct inode * inode);

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-10-29 00:41:48 -03:00
Arnaldo Carvalho de Melo e038f068b1 New dwarf: pfunct, see it in action:
[acme@newtoy net-2.6]$ pfunct ~acme/work/atag/atag | grep LRMI
void * LRMI_alloc_real(int size);
void LRMI_free_real(void * m);
int LRMI_init(void);
void set_regs(struct LRMI_regs * r);
void get_regs(struct LRMI_regs * r);
int LRMI_call(struct LRMI_regs * r);
int LRMI_int(int i, struct LRMI_regs * r);
[acme@newtoy net-2.6]$

[acme@newtoy net-2.6]$ pfunct kernel/sched.o task_running
int task_running(struct rq * rq, struct task_struct * p);
[acme@newtoy net-2.6]$

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
2006-10-28 19:07:45 -03:00