Commit Graph
180 Commits
Author SHA1 Message Date
Roger Pau Monne 9163062a39 tools/build: Introduce {PREPEND,APPEND}_{LIB,INCLUDES}
Create two new variables called APPEND_ and PREPEND_ to add compile
flags at the beginning or at the end of the search path.

Added a new semantic for user defined compile flags, here is the list
of possible options:

PREPEND_LIB: add libraries to the search path before xen
             (before xen installation folders).
PREPEND_INCLUDES: add headers to the search path before xen
                  (before xen installation folders).
APPEND_LIB: add libraries to the search path at the end
            (after all xen installation folders have been added).
APPEND_INCLUDES: add libraries to the search path at the end
                 (after all xen installation folders have been added).

EXTRA_INCLUDES and EXTRA_LIB can still be used, and they will have the
same effect as PREPEND_INCLUDES and PREPEND_LIB.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-11-14 18:14:07 +00:00
Olaf Hering d25db55e86 xenctx: add option -C to dump context for all vcpus
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-06-17 14:22:56 +02:00
Olaf Hering 84a7507768 xenctx: move xc_* access out of dump_ctx
move xc_* access out of dump_ctx.
Update code paths to return an error instead of calling exit().
On error unpause the guest if it was paused by xenctx.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-06-17 14:11:52 +02:00
Olaf Hering 79a7f14f57 xenctx: move all globals into struct xenctx
Move all globals used for options and libxc data into a new struct xenctx.
This is used in subsequent changes.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-06-17 14:10:18 +02:00
Olaf Hering 8c779c0f47 xenctx: recognize also -S option for --stack-trace
Update help text.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-06-17 14:09:32 +02:00
Keir Fraser 486fa85e92 Tracing facility for nested virtualization
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2011-04-14 14:57:24 +01:00
Christoph Egger d0c9dab138 tools/xentrace: decode 'continue_running' and 'RDTSC' entries.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2011-04-13 14:09:55 +01:00
Ian Campbell 9ac650d825 tools: remove pattern matched linking rules
Most subdirs only build a single tool to start with and those which
build multiple tools often have different linkage requirements.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-03-31 19:34:56 +01:00
Ian Campbell 61d0fe74c6 tools: Remove $(CFLAGS) from links lines.
The relevant variable in these circumstances is called $(LDFLAGS).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-03-31 19:32:18 +01:00
Keir Fraser 547cb1849c build: Make XEN_ROOT an absolute path.
Otherwise make can search the path relative to certain standard paths
such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in
Config.mk suffers from this).

Signed-off-by: Keir Fraser <keir@xen.org>
2011-03-17 10:36:25 +00:00
Keir Fraser e23f7e77ab xentrace: build fix "array subscript has type 'char'"
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2011-01-11 15:10:21 +00:00
Keir Fraser a7c8838ea7 xenctx: misc adjustments
- fix off-by-one errors during symbol insertion and lookup
- don't store the symbol type, as it wasn't needed at all so far and
  is only needed now at parsing time
- don't insert certain kinds of symbols

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-01-11 11:41:39 +00:00
Ian Campbell 3e446a35ee libxc: convert evtchn interfaces to use an opaque handle type
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>
2010-12-23 15:25:57 +00:00
Stefano Stabellini ba26a1e197 split LDLIBS from LDFLAGS to fix link errors in recent toolchains
Linker command lines are order-sensitive.
Move linker options -Lfoo -lfoo from LDFLAGS to LDLIBS and place this new
variable after the objects to link. This resolves build errors in xenpagin
and blktap with recent toolchains.

rename SHLIB_CFLAGS to SHLIB_LDFLAGS
rename LDFLAGS_* to LDLIBS_*
move LDFLAGS usage after CFLAGS in CC calls
remove stale comments in xenpaging Makefile

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-08-11 18:02:32 +01:00
Ian Jackson a87a580e8a tools/xentrace: increase default xentrace buffer size.
increase default xentrace buffer size to reduce the number of
lost records.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-07-08 17:39:00 +01:00
Keir Fraser 79bdfbb588 trace: share t_info pages only in read-only mode
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>
2010-06-29 18:18:42 +01:00
Keir Fraser bf27c9bb39 xentrace: update formats file for INTR_WINDOW and NPF
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-06-07 07:07:03 +01:00
Keir Fraser 5cc436c1d2 libxc: eliminate static variables, use xentoollog; API change
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>
2010-05-28 09:30:19 +01:00
Keir Fraser f4f16d740c xenctx: Add --kernel-start option, to set the user/kernel split
Used when displaying stack traces.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-05-27 08:19:47 +01:00
Keir Fraser 865f566d8c xentrace: install scripts with python install wrapper
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-05-15 08:29:21 +01:00
Keir Fraser 822cdd45d1 xentrace: Add missing help option
Describe the --reserve-disk-space option in the xentrace help.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-04-13 18:19:33 +01:00
Keir Fraser 70d3f227c6 xentrace: Add an option not to enable tracing
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>
2010-04-13 18:19:10 +01:00
Keir Fraser 7787576014 xentrace: Skip to low cpu when throwing away portions of the circular buffer
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>
2010-04-13 18:18:36 +01:00
Keir Fraser e0b0cd61d2 xentrace: Disable tracing, then read records one more time.
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>
2010-02-03 09:36:37 +00:00
Keir Fraser 41a41718c4 xentrace: XC_PAGE_SIZE should be used
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>
2010-01-21 09:13:46 +00:00
Keir Fraser 650afa3995 xentrace: Per-cpu xentrace buffers
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>
2010-01-20 20:33:35 +00:00
Keir Fraser 87b8f65a96 xentrace: fix "%016x" format
xentrace_format cannot use "0x016x" format as we expect.
It show only %(N) as "0x016x" format, not as "%(N+1)08x%(N)08x".
So I fixed tools/xentrace/formats by using "%(N+1)08x%(N)08x" format.
Also I added some TRC_PV entries.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2009-08-11 07:36:26 +01:00
Keir Fraser 71eb0dfc66 x86 Cx tracing: export the Cx exit reason (pending interrupt during Cx)
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
2009-06-29 11:01:50 +01:00
Keir Fraser c18a0f7d6d x86 Cx tracing: export expected/predicted Cx to xentrace
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
2009-06-29 11:00:56 +01:00
Keir Fraser 2e1b6a8dcc xentrace: Trace IRQs and entry/exit timestamps.
From: Dulloor <dulloor@gmail.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-05-19 02:08:01 +01:00
Keir Fraser 3326419806 xentrace: Clean up HVM I/O tracing.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-04-24 13:46:17 +01:00
Keir Fraser 48fe42ec0b xenctx, ia64: fix compilation error.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-04-02 11:48:32 +01:00
Keir Fraser 0a0346fc3f xenctx: Teach xenctx how to find the right addresses in real-mode.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-03-31 11:38:05 +01:00
Keir Fraser 49986faf5d xenctx: Always show code context, even when not in kernel mode
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-03-31 11:33:56 +01:00
Keir Fraser 93d17a53a3 xentrace: Add acpi pm tick output to idle tracing
The reason is that tsc stops and it causes the inaccuracy.
And later we can write some scripts based on this patch.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
2009-03-19 10:08:48 +00:00
Keir Fraser 677a041f1f xentrace: error handling on non-existent formats file
Attached patch does proper error handling when specified
formats file doesn't exist.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-03-12 15:07:20 +00:00
Keir Fraser 2b9a5bea15 xenctx: print x86_32 context on x86_64
Although x86_64 context covers x86_32, I think it's easy to watch.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-02-06 10:43:58 +00:00
Keir Fraser c8ff96bd9f xenctx support for 64-bit HVM guests
Now that we can easily find EFER.LMA, xenctx can detect 64-bit HVM
VCPUs

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-02-05 12:17:24 +00:00
Keir Fraser 9f8501582f Use -MMD -MF in tools/* rather than -Wp,-M...
If you use -MMD -MF then the correct .o filename is written to the
.*.d file as the compiler driver arranges everything.  This was done
in 19010:275abe1c5d24 for the hypervisor.

In this patch we do the same elsewhere in the xen-unstable tree,
particularly tools/.  Specifically:
 * Change tools/Rules.mk to add -MMD -MF ... to CFLAGS and set DEPS.
 * Remove -Wp,-MD... from every other Makefile
 * Remove setting of DEPS from every other Makefile
 * Ensure that every Makefile says -include $(DEPS)
 * Ensure that every Makefile's clean target removes $(DEPS)

Some Makefiles were already halfway there, but often for a different
variable name eg PROG_DEP.  The variable name is now standardised in
Rules.mk as DEPS.

I have done a test build with this change, on Debian etch.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-01-12 10:16:05 +00:00
Isaku Yamahata e2b255ceff [IA64] compilation fix of xenctx
This patch fixes the following compilation error caused by
18963:9cc632cc6d40 of xen-unstable.hg

> xenctx.c: In function 'print_ctx':
> xenctx.c:430: error: request for member 'c' in something not a structure or union
> xenctx.c:431: error: 'vcpu_guest_context_any_t' has no member named 'regs'
> xenctx.c:484: error: 'vcpu_guest_context_any_t' has no member named 'event_callback_ip'

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-01-07 12:20:31 +09:00
Keir Fraser 1d6e30c679 xenctx: compat-mode/HVM support
Add support to xenctx for guests that have a different word size
to the tools (x86 only, but shouldn't break ia64).  Again, only 32-bit
HVM guests are supported until EFER.LMA is easier to get at.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-01-05 11:08:53 +00:00
Keir Fraser a98892e3b0 xentrace: trace power management events.
Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
2008-10-16 09:51:42 +01:00
Keir Fraser dd7746fbf3 xenctx: fix xenctx --all option on x86
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2008-09-22 11:16:56 +01:00
Keir Fraser 652f427342 xentrace 7/7: Add option to log to a circular buffer and dump to disk
on signal.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
2008-09-08 16:02:13 +01:00
Keir Fraser be608b5e9b xentrace 6/7: Updated formats file.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
2008-09-08 16:00:53 +01:00
Keir Fraser a9318ed8b2 xentrace 4/7: Add some missing things to the xentrace options string
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
2008-09-08 15:52:50 +01:00
Keir Fraser 93b891026d xentrace: Fix typo in xentrace_formats file.
Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
Signed-off-by: Zhou Ting <ting.g.zhou@intel.com>
2008-08-21 11:12:21 +01:00
Keir Fraser 7eb8d34c18 tools: Declare functions static where they should be, and provide
proper prototypes for others as required.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2008-07-15 13:19:26 +01:00
Keir Fraser a1b2027c86 Compilation fix for x86_64 caused by 17880:d3a87899985d.
Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
2008-06-20 12:18:10 +01:00
Keir Fraser 50bddc9307 libxc: The following patch replace the libxc interface to use
vcpu_guest_context_any_t (which is both 32 and 64 bits) instead of
vcpu_guest_context_t.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
2008-06-19 16:15:05 +01:00