// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2002-2005 Roman Zippel * Copyright (C) 2002-2005 Sam Ravnborg */ #include #include #include #include #include #include #include "lkc.h" /* hash table of all parsed Kconfig files */ static HASHTABLE_DEFINE(file_hashtable, 1U << 11); struct file { struct hlist_node node; char name[]; }; /* file already present in list? If not add it */ const char *file_lookup(const char *name) { struct file *file; size_t len; int hash = hash_str(name); hash_for_each_possible(file_hashtable, file, node, hash) if (!strcmp(name, file->name)) return file->name; len = strlen(name); file = xmalloc(sizeof(*file) + len + 1); memset(file, 0, sizeof(*file)); memcpy(file->name, name, len); file->name[len] = '\0'; hash_add(file_hashtable, &file->node, hash); str_printf(&autoconf_cmd, "\t%s \\\n", name); return file->name; } /* Allocate initial growable string */ struct gstr str_new(void) { struct gstr gs; gs.s = xmalloc(sizeof(char) * 64); gs.len = 64; gs.max_width = 0; strcpy(gs.s, "\0"); return gs; } /* Free storage for growable string */ void str_free(struct gstr *gs) { free(gs->s); gs->s = NULL; gs->len = 0; } /* Append to growable string */ void str_append(struct gstr *gs, const char *s) { size_t l; if (s) { l = strlen(gs->s) + strlen(s) + 1; if (l > gs->len) { gs->s = xrealloc(gs->s, l); gs->len = l; } strcat(gs->s, s); } } /* Append printf formatted string to growable string */ void str_printf(struct gstr *gs, const char *fmt, ...) { va_list ap; char s[10000]; /* big enough... */ va_start(ap, fmt); vsnprintf(s, sizeof(s), fmt, ap); str_append(gs, s); va_end(ap); } /* Retrieve value of growable string */ char *str_get(const struct gstr *gs) { return gs->s; } -2.6.27.y Hosts the 0x221E linux distro kernel.Ubuntu
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2009-12-05Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kern...Linus Torvalds
2009-11-02kprobes: Sanitize struct kretprobe_instance allocationsAnanth N Mavinakayanahalli
2009-10-17Merge commit 'v2.6.32-rc5' into perf/probesIngo Molnar
2009-10-01const: constify remaining file_operationsAlexey Dobriyan
2009-09-23Merge commit 'linus/master' into tracing/kprobesFrederic Weisbecker
2009-09-23seq_file: constify seq_operationsJames Morris
2009-09-17kprobes: Prevent re-registration of the same kprobeAnanth N Mavinakayanahalli
2009-09-11kprobes/x86-32: Move irq-exit functions to kprobes sectionMasami Hiramatsu
2009-08-30kprobes: Prohibit to probe native_get_debugregMasami Hiramatsu
2009-08-27tracing/kprobes: Dump the culprit kprobe in case of kprobe recursionFrederic Weisbecker
2009-08-11Merge branch 'linus' into tracing/coreIngo Molnar
2009-07-30kprobes: Use kernel_text_address() for checking probe addressMasami Hiramatsu
2009-07-01kprobes: Clean up insn_pages by using list instead of hlistMasami Hiramatsu
2009-07-01kprobes: No need to unlock kprobe_insn_mutexMasami Hiramatsu
2009-05-08kprobes: fix to use text_mutex around arm/disarm kprobeMasami Hiramatsu
2009-04-07kprobes: support per-kprobe disablingMasami Hiramatsu
2009-04-07kprobes: rename kprobe_enabled to kprobes_all_disarmedMasami Hiramatsu
2009-04-07kprobes: move EXPORT_SYMBOL_GPL just after function definitionsMasami Hiramatsu
2009-04-07kprobes: cleanup aggr_kprobe related codeMasami Hiramatsu
2009-03-18kprobes: Fix locking imbalance in kretprobesAnanth N Mavinakayanahalli
2009-03-06tracing, Text Edit Lock - kprobes architecture independent supportMathieu Desnoyers
2009-01-16kprobes: check CONFIG_FREEZER instead of CONFIG_PMMasami Hiramatsu
2009-01-06kprobes: support probing module __init functionMasami Hiramatsu
2009-01-06kprobes: remove called_from argumentMasami Hiramatsu
2009-01-06kprobes: support probing module __exit functionMasami Hiramatsu
2009-01-06kprobes: add __kprobes to kprobe internal functionsMasami Hiramatsu
2009-01-06kprobes: add kprobe_insn_mutex and cleanup arch_remove_kprobe()Masami Hiramatsu
2009-01-06kprobes: bugfix: try_module_get even if calling_mod is NULLMasami Hiramatsu
2008-11-12kernel/kprobes.c: don't pad kretprobe_table_locks[] on uniprocessor buildsAndrew Morton
2008-11-12kprobes: disable preempt for module_text_address() and kernel_text_address()Masami Hiramatsu
2008-10-16make kprobes.c:kretprobe_table_lock() staticAdrian Bunk
2008-07-25kprobes: remove redundant config checkAbhishek Sagar
2008-07-25kprobes: improve kretprobe scalability with hashed lockingSrinivasa D S
2008-07-10kernel/kprobes.c: Made kprobe_blacklist static.Daniel Guilak
2008-06-12kprobes: fix error checking of batch registrationMasami Hiramatsu
2008-04-28kprobes: add (un)register_jprobes for batch registrationMasami Hiramatsu
2008-04-28kprobes: add (un)register_kretprobes for batch registrationMasami Hiramatsu
2008-04-28kprobes: add (un)register_kprobes for batch registrationMasami Hiramatsu
2008-04-28kprobes: prevent probing of preempt_schedule()Srinivasa Ds
2008-03-04kprobes: fix a null pointer bug in register_kretprobe()Masami Hiramatsu
2008-03-04Kprobes: indicate kretprobe support in KconfigAnanth N Mavinakayanahalli