+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>
* process.c (read_maps): Set inode for vdso to 0.
endif
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
MODCFLAGS := -DMODULE -D__KERNEL__ -Wall ${INCLUDE}
#if 0
int stacksize;
#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;
/* 0: locked, 1: unlocked */
out:
atomic_inc(&in_timer_notify);
+
return 0;
}
build.instructions = g_array_new (TRUE, TRUE, sizeof (Instruction));
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);
- return NULL;
+ return NULL;
}
if (!scontext_is_finished (build.context))