mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
Add forgotten put_cpu_var(). Parse in chunks of 65536 to improve locality.
2006-12-09 Soren Sandmann <sandmann@daimi.au.dk> * module/sysprof-module.c: Add forgotten put_cpu_var(). * sfile.c (build_instructions): Parse in chunks of 65536 to improve locality.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
4ba672ee9f
commit
bd1f064ad3
@ -1,3 +1,9 @@
|
|||||||
|
2006-12-09 Soren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
|
* module/sysprof-module.c: Add forgotten put_cpu_var().
|
||||||
|
* sfile.c (build_instructions): Parse in chunks of 65536 to
|
||||||
|
improve locality.
|
||||||
|
|
||||||
2006-11-23 Soren Sandmann <sandmann@daimi.au.dk>
|
2006-11-23 Soren Sandmann <sandmann@daimi.au.dk>
|
||||||
|
|
||||||
* process.c (read_maps): Set inode for vdso to 0.
|
* process.c (read_maps): Set inode for vdso to 0.
|
||||||
|
|||||||
@ -10,7 +10,7 @@ PREFIX := /usr/local
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
MODULE := sysprof-module
|
MODULE := sysprof-module
|
||||||
KDIR := /lib/modules/$(shell uname -r)/build
|
KDIR := /lib/modules/$(shell uname -r)/build # /home/ssp/linux-2.6.19/
|
||||||
INCLUDE := -isystem $(KDIR)/include
|
INCLUDE := -isystem $(KDIR)/include
|
||||||
MODCFLAGS := -DMODULE -D__KERNEL__ -Wall ${INCLUDE}
|
MODCFLAGS := -DMODULE -D__KERNEL__ -Wall ${INCLUDE}
|
||||||
|
|
||||||
|
|||||||
@ -126,8 +126,12 @@ timer_notify (struct pt_regs *regs)
|
|||||||
#if 0
|
#if 0
|
||||||
int stacksize;
|
int stacksize;
|
||||||
#endif
|
#endif
|
||||||
|
int n;
|
||||||
|
|
||||||
if (((++get_cpu_var(n_samples)) % INTERVAL) != 0)
|
n = ++get_cpu_var(n_samples);
|
||||||
|
put_cpu_var(n_samples);
|
||||||
|
|
||||||
|
if (n % INTERVAL != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* 0: locked, 1: unlocked */
|
/* 0: locked, 1: unlocked */
|
||||||
@ -216,6 +220,7 @@ timer_notify (struct pt_regs *regs)
|
|||||||
|
|
||||||
out:
|
out:
|
||||||
atomic_inc(&in_timer_notify);
|
atomic_inc(&in_timer_notify);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
18
sfile.c
18
sfile.c
@ -628,11 +628,25 @@ build_instructions (const char *contents,
|
|||||||
build.instructions = g_array_new (TRUE, TRUE, sizeof (Instruction));
|
build.instructions = g_array_new (TRUE, TRUE, sizeof (Instruction));
|
||||||
|
|
||||||
parse_context = g_markup_parse_context_new (&parser, 0, &build, NULL);
|
parse_context = g_markup_parse_context_new (&parser, 0, &build, NULL);
|
||||||
|
|
||||||
|
while (length)
|
||||||
|
{
|
||||||
|
int bytes = MIN (length, 65536);
|
||||||
|
|
||||||
|
if (!g_markup_parse_context_parse (parse_context, contents, bytes, err))
|
||||||
|
{
|
||||||
|
free_instructions ((Instruction *)build.instructions->data, build.instructions->len);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
contents += bytes;
|
||||||
|
length -= bytes;
|
||||||
|
}
|
||||||
|
|
||||||
if (!g_markup_parse_context_parse (parse_context, contents, length, err))
|
if (!g_markup_parse_context_end_parse (parse_context, err))
|
||||||
{
|
{
|
||||||
free_instructions ((Instruction *)build.instructions->data, build.instructions->len);
|
free_instructions ((Instruction *)build.instructions->data, build.instructions->len);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!scontext_is_finished (build.context))
|
if (!scontext_is_finished (build.context))
|
||||||
|
|||||||
Reference in New Issue
Block a user