summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm_pcpu.c
Commit message (Collapse)AuthorAgeFilesLines
* lib: minor spelling fixes in comments.pfg2016-05-011-1/+1
| | | | No functional change.
* Add support to libkvm for reading vmcores from other architectures.jhb2015-11-271-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a kvaddr_type to represent kernel virtual addresses instead of unsigned long. - Add a struct kvm_nlist which is a stripped down version of struct nlist that uses kvaddr_t for n_value. - Add a kvm_native() routine that returns true if an open kvm descriptor is for a native kernel and memory image. - Add a kvm_open2() function similar to kvm_openfiles(). It drops the unused 'swapfile' argument and adds a new function pointer argument for a symbol resolving function. Native kernels still use _fdnlist() from libc to resolve symbols if a resolver function is not supplied, but cross kernels require a resolver. - Add a kvm_nlist2() function similar to kvm_nlist() except that it uses struct kvm_nlist instead of struct nlist. - Add a kvm_read2() function similar to kvm_read() except that it uses kvaddr_t instead of unsigned long for the kernel virtual address. - Add a new kvm_arch switch of routines needed by a vmcore backend. Each backend is responsible for implementing kvm_read2() for a given vmcore format. - Use libelf to read headers from ELF kernels and cores (except for powerpc cores). - Add internal helper routines for the common page offset hash table used by the minidump backends. - Port all of the existing kvm backends to implement a kvm_arch switch and to be cross-friendly by using private constants instead of ones that vary by platform (e.g. PAGE_SIZE). Static assertions are present when a given backend is compiled natively to ensure the private constants match the real ones. - Enable all of the existing vmcore backends on all platforms. This means that libkvm on any platform should be able to perform KVA translation and read data from a vmcore of any platform. Tested on: amd64, i386, sparc64 (marius) Differential Revision: https://reviews.freebsd.org/D3341
* Remove trailing whitespace.jhb2015-11-261-1/+1
|
* Add kvm_getncpus() to obtain mp_ncpus.glebius2014-02-121-0/+10
| | | | Sponsored by: Nginx, Inc.
* While it isn't too late and kvm_read_zpcpu() function isn't yet usedglebius2014-02-121-2/+2
| | | | | | | outside libkvm(3), change its order of arguments, so that it is the same as in kvm_read(). Sponsored by: Nginx, Inc.
* Revert r256514 for libkvm. It wasn't correct actually and breaks build.glebius2013-10-151-3/+1
|
* - While we are spreading the counter(9) across network stack, more userlandglebius2013-10-151-1/+3
| | | | | | | | | tools would need to know about the counter_u64_t type. Allow to include sys/counter.h from userspace. - Utilize now defined type in kvm_counter_u64_fetch(). Sponsored by: Netflix Sponsored by: Nginx, Inc.
* o Provide function kvm_read_zpcpu() to access UMA_ZONE_PCPU allocations.glebius2013-04-101-3/+48
| | | | | | o Provide function kvm_counter_u64_fetch() to fetch valut of a counter(9). Sponsored by: Nginx, Inc.
* With retirement of cpumask_t and usage of cpuset_t for representing aattilio2011-07-041-29/+2
| | | | | | | | | | | | | | | mask of CPUs, pc_other_cpus and pc_cpumask become highly inefficient. Remove them and replace their usage with custom pc_cpuid magic (as, atm, pc_cpumask can be easilly represented by (1 << pc_cpuid) and pc_other_cpus by (all_cpus & ~(1 << pc_cpuid))). This change is not targeted for MFC because of struct pcpu members removal and dependency by cpumask_t retirement. MD review by: marcel, marius, alc Tested by: pluknet MD testing by: marcel, marius, gonzo, andreast
* Revert r222363, as bde@ pointed out the initial solution was far moreattilio2011-05-311-1/+1
| | | | correct.
* Style fix: cast to size_t rather than u_long when comparing to sizeof()attilio2011-05-271-1/+1
| | | | | | rets. Requested by: kib
* In the near future cpuset_t objects in struct pcpu will be axed out, butattilio2011-05-271-2/+29
| | | | | | | | as long as this does not happen, we need to fix interfaces to userland in order to not break run-time accesses to the structure. Reviwed by: kib Tested by: pluknet
* libkvm code janitoringuqs2011-01-231-11/+10
| | | | | | | | | | | | - make WARNS=6 clean for archs w/o strict alignment requirments - add const, ANSIfy, remove unused vars, cast types for comparison - thanks to differing definitions of VM_MIN_ADDRESS across our archs, we need to trick the compiler to not complain about signedness. We could either fix VM_MIN_ADDRESS to always be a simple integer or make the check conditional on $ARCH. Closes PRs: kern/42386, kern/83364 Reviewed by: bde
* Similar to sys/net/vnet.h, define the linker set name for sys/sys/pcpu.hdim2010-11-141-2/+2
| | | | as a macro, and use it instead of literal strings.
* A first cut at teaching libkvm how to deal with dynamic per-CPU storagerwatson2010-03-011-0/+140
| | | | | | | | | | | | | | | | | (DPCPU): A new API, kvm_dpcpu_setcpu(3), selects the active CPU for the purposes of DPCPU. Calls to kvm_nlist(3) will automatically translate DPCPU symbols and return a pointer to the current CPU's version of the data. Consumers needing to read the same symbol on several CPUs will invoke a series of setcpu/nlist calls, one per CPU of interest. This addition makes it possible for tools like netstat(1) to query the values of DPCPU variables during crashdump analysis, and is based on similar code handling virtualized global variables. MFC after: 1 week Sponsored by: Juniper Networks, Inc.
* Add two new routines to libkvm for working with per-CPU data:jhb2008-08-191-0/+152
kvm_getmaxcpu() and kvm_getpcpu(). MFC after: 1 week
OpenPOWER on IntegriCloud