aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xentrace/xentrace.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix emacs local variable block to use correct C style variable.David Vrabel2013-02-211-1/+1
| | | | | | | The emacs variable to set the C style from a local variable block is c-file-style, not c-set-style. Signed-off-by: David Vrabel <david.vrabel@citrix.com
* libxc: convert evtchn interfaces to use an opaque handle typeIan Campbell2010-12-231-8/+7
| | | | | | | | | | | | This makes the interface consistent with the changes made to the main interface in 21483:779c0ef9682c. Also fix some references to "struct xc_interface" which should have been simply "xc_interface" in tools/xenpaging, and update QEMU_TAG to pull in the corresponding qemu change. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools/xentrace: increase default xentrace buffer size.Ian Jackson2010-07-081-1/+1
| | | | | | | increase default xentrace buffer size to reduce the number of lost records. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* trace: share t_info pages only in read-only modeKeir Fraser2010-06-291-5/+5
| | | | | | | | There's no need to share writably the t_info pages (Dom0 only wants [and needs] to read it) Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-281-7/+7
| | | | | | | | | | | | | | | | | | | | This patch eliminate the global variables in libxenctrl (used for logging and error reporting). Instead the information which was in the global variables is now in a new xc_interface* opaque structure, which xc_interface open returns instead of the raw file descriptor; furthermore, logging is done via xentoollog. There are three new parameters to xc_interface_open to control the logging, but existing callers can just pass "0" for all three to get the old behaviour. All libxc callers have been adjusted accordingly. Also update QEMU_TAG for corresponding qemu change. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xentrace: Add missing help optionKeir Fraser2010-04-131-0/+3
| | | | | | Describe the --reserve-disk-space option in the xentrace help. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* xentrace: Add an option not to enable tracingKeir Fraser2010-04-131-2/+16
| | | | | | | | | Add an option that will set up the buffers and listen for updates, but will not enable tracing. This is useful if you have hacks in Xen to enable tracing at key points (for example, debugging a shadow bug). Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* xentrace: Skip to low cpu when throwing away portions of the circular bufferKeir Fraser2010-04-131-0/+15
| | | | | | | Skip to the next "low" cpu when throwing away portions of the circular memory buffer. This makes subsequent analysis easier. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* xentrace: Disable tracing, then read records one more time.Keir Fraser2010-02-031-4/+14
| | | | | | | | | | | When interrupted, first disable tracing, then read through the records one last time. Without this patch, it's possible to get traces which interact (such as runstate changes) on processors with higher numbers, while missing the corresponding traces generated on lower-numbered processors. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* xentrace: XC_PAGE_SIZE should be usedKeir Fraser2010-01-211-1/+1
| | | | | | | | | 20827:fad80160c001 cannot be compiled on ia64: xentrace.c:647: error: 'PAGE_SIZE' undeclared (first use in this This patch fixes it. Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
* xentrace: Per-cpu xentrace buffersKeir Fraser2010-01-201-73/+60
| | | | | | | | | | | | | | | | In the current xentrace configuration, xentrace buffers are all allocated in a single contiguous chunk, and then divided among logical cpus, one buffer per cpu. The size of an allocatable chunk is fairly limited, in my experience about 128 pages (512KiB). As the number of logical cores increase, this means a much smaller maximum per-cpu trace buffer per cpu; on my dual-socket quad-core nehalem box with hyperthreading (16 logical cpus), that comes to 8 pages per logical cpu. This patch addresses this issue by allocating per-cpu buffers separately. Signed-off-by: George Dunlap <dunlapg@umich.edu>
* xentrace 7/7: Add option to log to a circular buffer and dump to diskKeir Fraser2008-09-081-44/+345
| | | | | | | on signal. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
* xentrace 4/7: Add some missing things to the xentrace options stringKeir Fraser2008-09-081-1/+1
| | | | | Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
* tools: Declare functions static where they should be, and provideKeir Fraser2008-07-151-14/+14
| | | | | | proper prototypes for others as required. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* Fix non-portability in xentraceKeir Fraser2008-02-281-4/+4
| | | | | | | Replace statfs() with the equivalent statvfs(), and correct the block size multiplier. Signed-off-by: John Levon <john.levon@sun.com>
* xentrace: Add a time parameterKeir Fraser2008-02-261-1/+12
| | | | Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* xentrace: Disable tracing by default on exitKeir Fraser2008-02-261-1/+38
| | | | | Includes an option to disable this behavior. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* xentrace: Add option to reserve disk spaceKeir Fraser2008-02-261-2/+38
| | | | | | Before writing records, xentrace will check to make sure that there is a minimum amount of space left on the output filesystem. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* xentrace: Fix --discard-buffers optionKeir Fraser2008-02-261-0/+7
| | | | Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* libxenctrl headers should not pollute macro namespace withKeir Fraser2008-02-121-3/+3
| | | | | | | mb/rmb/wmb. Instead add a xen_ prefix. Modify Xen's public headers to expect the prefixed names instead of bare mb/rmb/wmb, but gate this expectation on a bump of __XEN_INTERFACE_VERSION__. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* xentrace: Improve xentrace to use VIRQ_TBUF interrupts as well as aKeir Fraser2008-02-111-56/+82
| | | | | | | | user-specified polling interval in order to determine when to empty the trace buffers. Removed the old and unused/unimplemented new_data_threshold logic. Signed-off-by: Michael A Fetterman <Michael.Fetterman@cl.cam.ac.uk>
* xentrace: Allow xentrace to handle >4G of trace data.Keir Fraser2008-02-111-2/+11
| | | | | | | | | | | | | It was previously assert'ing when it hit 4G. Also, because the trace buffer is not a power of 2 in size, using modulo arithmetic to address the buffer does not work when the index wraps around 2^32. This patch fixes both issues, and as a side effect, removes all integer division from the hypervisor side of the trace mechanism. Signed-off-by: Michael A Fetterman <Michael.Fetterman@cl.cam.ac.uk>
* xentrace: Don't append trace on existing file.Keir Fraser2007-12-041-7/+7
| | | | | | | | | | | | | When you run "xentrace -e <mask> trace.output" the first time, all is fine. When you run it a second time, then the data is appended which makes you reading old data with xentrace_format and you interprete it as new data. This usually happens when you automated tracing guests with xentrace and xentrace_format with a script. Therefore, attached patch makes xentrace to truncate the file to zero bytes before writing any data. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* xentrace: make xentrace and xenmon work on Solaris and *BSD.Keir Fraser2007-11-161-138/+126
| | | | | | | | | | | | - Use getopt() to get rid of argp dependency which does not exist on Solaris and *BSD. Done by Tariq Magdon-Ismail. - Minor modifications by me (Christoph) to make it also work on *BSD. - Tested on Linux by me (Christoph). No functional change on Linux. - Tariq ok'd BSD modifications for Solaris - Tariq ok'd submission by me :) Signed-off-by: Tariq Magdon-Ismail <tariqmi@sun.com> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* xentrace: Fix race in updating consumer ring index.Keir Fraser2007-10-251-1/+1
| | | | | From: George Dunlap <gdunlap@xensource.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Replace sysctl.physinfo.sockets_per_node with more directly usefulKeir Fraser2007-10-191-4/+1
| | | | | | | | sysctl.physinfo.nr_cpus. This also avoids miscalculation of sockets_per_node by Xen where the number of CPUs in the system is clipped. From: Elizabeth Kon <eak@us.ibm.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Fix xentrace build.Keir Fraser2007-09-241-2/+2
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Xen tracing cleanups and fixes.Keir Fraser2007-09-241-8/+12
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [xen][tracing] Introduce variable-size trace recordsGeorge Dunlap2007-09-211-28/+104
| | | | | | | | | | | | | | | | | | | This patch introduces variable-size trace records. Each record consists of a 32-bit "header", an optional cycle count, and up to seven more 32-bit words. The header is packed with the following information: bits 0-27: The trace event. bits 28-30: The number of 32-bit "extra" words in the records bit 31: Does the trace include a 64-bit tsc? This patch standardizes behavior wrt 32 and 64-bit hypervisors and dom0s. Note that this patch requires a new version of the xentrace daemon running in dom0. The new daemon, instead of pre-pending the cpu to every record as it writes it, inserts a "cpu change" record to the trace file that record the cpu and the number of records it's about to write. Signed-off-by: George Dunlap <gdunlap@xensource.com>
* Extended the physinfo sysctl to export NUMA cpu_to_node topology info.kfraser@localhost.localdomain2007-07-061-1/+1
| | | | | | Print this in 'xm info'. Signed-off-by: Ryan Harper <ryanh@us.ibm.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* xentrace: Bit-field boolean must be unsigned.kfraser@localhost.localdomain2007-06-041-8/+5
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [TOOLS] Make xentrace help a little more informative.George Dunlap2007-02-271-2/+4
| | | | Signed-off-by: George Dunlap <gdunlap@xensource.com>
* [TOOLS] Added option to xentrace to discard records in the bufferGeorge Dunlap2007-02-271-0/+19
| | | | | | before beginning the trace. Signed-off-by: George Dunlap <gdunlap@xensource.com>
* Missing files from previous changeset.kfraser@localhost.localdomain2007-02-261-2/+2
| | | | Signed-off-by: Thomas Friebel <thomas.friebel@amd.com>
* Added option to xentrace to set the trace buffer size.George Dunlap2006-08-211-1/+20
| | | | | Signed-off-by: George Dunlap <gdunlap@xensource.com>
* Use common code for enabling tracing via xenmon and xentrace, also fixingkaf24@firebug.cl.cam.ac.uk2006-05-161-53/+9
| | | | | | | the last two remaining xc_private.h users outside of libxc. Signed-off-by: John Levon <john.levon@sun.com>
* Fix xentrace to initialise the trace buffers if they are not set up.kaf24@firebug.cl.cam.ac.uk2006-05-121-11/+48
| | | | | Signed-off-by: Atsushi SAKAI <sakaia@jp.fujitsu.com>
* Move Linux-specific privcmd code into private libxc implementations.kaf24@firebug.cl.cam.ac.uk2006-05-021-40/+35
| | | | | | | | | Make header path for kernel's privcmd/evtchn headers generic. Remove pointless xi_*() interface that was using private libxc interfaces. Signed-off-by: John Levon <john.levon@sun.com>
* This patch is mainly a cleanup of vmx related xentrace code. One minorkaf24@firebug.cl.cam.ac.uk2006-03-241-1/+1
| | | | | | | | | xentrace bug is fixed. Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com> Signed-off-by: Yunfeng Zhao <yunfeng.zhao@intel.com>
* More build config changes:kaf24@firebug.cl.cam.ac.uk2006-03-101-1/+1
| | | | | | | | | | - Build -O2 rather than -O3 - Build with -Wstrict-prototypes - Move target-specific generic compiler switches to Config.mk Signed-off-by: Keir Fraser <keir@xensource.com>
* Clean up the interface for sharing xen-heap pages with guests.kaf24@firebug.cl.cam.ac.uk2006-03-091-1/+1
| | | | | | | | Map trace buffer pages as DOMID_XEN pages. Signed-off-by: Keir Fraser <keir@xensource.com>
* Sanitise the trace-buffer hypervisor<->user interface.kaf24@firebug.cl.cam.ac.uk2005-10-311-45/+13
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Fix Xen public interfaces and the tools to consistentlykaf24@firebug.cl.cam.ac.uk2005-10-121-4/+5
| | | | | | | | use stdint-format bitsize types (uint32_t and friends). Signed-off-by: Keir Fraser <keir@xensource.com>
* Fix typo.adsharma@los-vmm.sc.intel.com2005-08-251-1/+1
|
* Get rid of memory_t. Almost all uses should be unsigned long.kaf24@firebug.cl.cam.ac.uk2005-08-191-15/+15
| | | | | | | | | | | | The few uses for a physical/machine address have been mostly changed to u64. Grant table code probably needs auditing for PAE correctness, but at least the interface is now sound. Signed-off-by: Keir Fraser <keir@xensource.com>
* Implement event filtering command line options for xentrace.kaf24@firebug.cl.cam.ac.uk2005-08-111-0/+95
| | | | | | | Signed-off-by: Edwin Zhai <edwin.zhai@intel.com> Signed-off-by: Arun Sharma <arun.sharma@intel.com>
* Rename fields in physinfo_t structure and add sockets/nodeskaf24@firebug.cl.cam.ac.uk2005-07-041-1/+4
| | | | | fields.
* bitkeeper revision 1.1286 (425a96ca5UAvnSzOyOKUFxfHjMVm9g)bren@br260.wolfson.cam.ac.uk2005-04-111-2/+6
| | | | | | | | Define atomic functions ourselves rather than relying on kernel headers under "/usr/include". Signed-off-by: bin.ren@cl.cam.ac.uk
* bitkeeper revision 1.1278.1.1 (4254b244uWvJejlkGeqN8mp1CLtN5w)bren@br260.wolfson.cam.ac.uk2005-04-071-23/+25
| | | | | | | | | | New Xen trace buffer implementation that avoids blocking interrupts. Add support for trace buffer CPU mask and event mask. Add support for trace classes. New DOM0 trace buffer hypercall. Fix 'xentrace' signal handler bug. Signed-off-by: bin.ren@cl.cam.ac.uk
* bitkeeper revision 1.1229 (42180985F67QALsnFjovJHWiIDEz_A)kaf24@scramble.cl.cam.ac.uk2005-02-201-2/+8
| | | | | | | Fix return-code checking in tools. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Keir Fraser <keir@xensource.com>