/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as * published by the Free Software Foundation. * * Copyright (C) 2015 Naveen N. Rao, IBM Corporation */ #include "debug.h" #include "symbol.h" #include "map.h" #include "probe-event.h" #ifdef HAVE_LIBELF_SUPPORT bool elf__needs_adjust_symbols(GElf_Ehdr ehdr) { return ehdr.e_type == ET_EXEC || ehdr.e_type == ET_REL || ehdr.e_type == ET_DYN; } #endif #if !defined(_CALL_ELF) || _CALL_ELF != 2 int arch__choose_best_symbol(struct symbol *syma, struct symbol *symb __maybe_unused) { char *sym = syma->name; /* Skip over any initial dot */ if (*sym == '.') sym++; /* Avoid "SyS" kernel syscall aliases */ if (strlen(sym) >= 3 && !strncmp(sym, "SyS", 3)) return SYMBOL_B; if (strlen(sym) >= 10 && !strncmp(sym, "compat_SyS", 10)) return SYMBOL_B; return SYMBOL_A; } /* Allow matching against dot variants */ int arch__compare_symbol_names(const char *namea, const char *nameb) { /* Skip over initial dot */ if (*namea == '.') namea++; if (*nameb == '.') nameb++; return strcmp(namea, nameb); } #endif #if defined(_CALL_ELF) && _CALL_ELF == 2 #ifdef HAVE_LIBELF_SUPPORT void arch__sym_update(struct symbol *s, GElf_Sym *sym) { s->arch_sym = sym->st_other; } #endif #define PPC64LE_LEP_OFFSET 8 void arch__fix_tev_from_maps(struct perf_probe_event *pev, struct probe_trace_event *tev, struct map *map, struct symbol *sym) { int lep_offset; /* * When probing at a function entry point, we normally always want the * LEP since that catches calls to the function through both the GEP and * the LEP. Hence, we would like to probe at an offset of 8 bytes if * the user only specified the function entry. * * However, if the user specifies an offset, we fall back to using the * GEP since all userspace applications (objdump/readelf) show function * disassembly with offsets from the GEP. * * In addition, we shouldn't specify an offset for kretprobes. */ if (pev->point.offset || (!pev->uprobes && pev->point.retprobe) || !map || !sym) return; lep_offset = PPC64_LOCAL_ENTRY_OFFSET(sym->arch_sym); if (map->dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS) tev->point.offset += PPC64LE_LEP_OFFSET; else if (lep_offset) { if (pev->uprobes) tev->point.address += lep_offset; else tev->point.offset += lep_offset; } } #ifdef HAVE_LIBELF_SUPPORT void arch__post_process_probe_trace_events(struct perf_probe_event *pev, int ntevs) { struct probe_trace_event *tev; struct map *map; struct symbol *sym = NULL; struct rb_node *tmp; int i = 0; map = get_target_map(pev->target, pev->uprobes); if (!map || map__load(map) < 0) return; for (i = 0; i < ntevs; i++) { tev = &pev->tevs[i]; map__for_each_symbol(map, sym, tmp) { if (map->unmap_ip(map, sym->start) == tev->point.address) arch__fix_tev_from_maps(pev, tev, map, sym); } } } #endif /* HAVE_LIBELF_SUPPORT */ #endif /sound?h=nds-private-remove&id=883af14e67e8b8702b5560aa64c888c0cd0bd66c'>sound/pci/ctxfi/ctatc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 16:54:39 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 16:54:39 -0800
commit883af14e67e8b8702b5560aa64c888c0cd0bd66c (patch)
tree74e3a6b53f5fad9f7848ab1b9f6921b7012940a4 /sound/pci/ctxfi/ctatc.c
parent0263d4ebd94b36280608e296cba39b924b6e832b (diff)
parentaab45453ff5c77200c6da4ac909f7a4392aed17e (diff)
Merge branch 'akpm' (patches from Andrew)
Merge fixes from Andrew Morton: "26 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (26 commits) MAINTAINERS: add Dan Streetman to zbud maintainers MAINTAINERS: add Dan Streetman to zswap maintainers mm: do not export ioremap_page_range symbol for external module mn10300: fix build error of missing fpu_save() romfs: use different way to generate fsid for BLOCK or MTD frv: add missing atomic64 operations mm, page_alloc: fix premature OOM when racing with cpuset mems update mm, page_alloc: move cpuset seqcount checking to slowpath mm, page_alloc: fix fast-path race with cpuset update or removal mm, page_alloc: fix check for NULL preferred_zone kernel/panic.c: add missing \n fbdev: color map copying bounds checking frv: add atomic64_add_unless() mm/mempolicy.c: do not put mempolicy before using its nodemask radix-tree: fix private list warnings Documentation/filesystems/proc.txt: add VmPin mm, memcg: do not retry precharge charges proc: add a schedule point in proc_pid_readdir() mm: alloc_contig: re-allow CMA to compact FS pages mm/slub.c: trace free objects at KERN_INFO ...
Diffstat (limited to 'sound/pci/ctxfi/ctatc.c')