Fix 'make doc' and turn http://... into real links.
[virt-mem.git] / lib / virt_mem.mli
1 (** Memory info for virtual domains. *)
2 (* Memory info for virtual domains.
3    (C) Copyright 2008 Richard W.M. Jones, Red Hat Inc.
4    http://libvirt.org/
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *)
20
21 type ksym = string
22   (** A kernel symbol name. *)
23
24 type image =
25     int option
26     * string
27     * Virt_mem_utils.architecture
28     * ([`Wordsize], [`Endian], [`HasMapping]) Virt_mem_mmap.t
29   (** A memory image from a domain. *)
30
31 type image_with_ksyms =
32     int option
33     * string
34     * Virt_mem_utils.architecture
35     * ([`Wordsize], [`Endian], [`HasMapping]) Virt_mem_mmap.t
36     * (ksym -> Virt_mem_mmap.addr)
37   (** An image after it has been processed to find kernel symbols.
38
39       The tuple fields are:
40       - domain ID (if known)
41       - name, usually the domain name
42       - architecture (eg. I386)
43       - kernel memory map (wordsize & endianness already determined)
44       - a function to look up kernel symbols.  It raises [Not_found]
45         if a kernel symbol could not be found or if the kernel symbol
46         table could not be found at all.
47   *)
48
49 val register :
50   ?external_cmd:bool ->
51   ?extra_args:(Arg.key * Arg.spec * Arg.doc) list ->
52   ?argcheck:(bool -> unit) ->
53   ?beforeksyms:(bool -> image list -> unit) ->
54   ?run:(bool -> image_with_ksyms list -> unit) ->
55   string -> string -> Arg.usage_msg ->
56   unit
57   (** Tools register themselves with this call.
58
59       The anonymous parameters are:
60       - tool name (eg. "uname")
61       - short summary
62       - full usage message
63
64       The optional callback functions are:
65       - [?argcheck] called after arguments have been fully parsed
66       so that the program can do any additional checks needed (eg.
67       on [extra_args]),
68       - [?beforeksyms] called after images are loaded and before
69       kernel symbols are analyzed,
70       - [?run] called after kernel symbols have been analyzed
71       (almost all tools supply this callback function).
72
73       Pass [~external_cmd:false] if this tool doesn't have an
74       external 'virt-tool' link.
75
76       Pass [~extra_args:...] if this tool needs extra command
77       line options.
78   *)
79
80 val main : unit -> unit
81   (** Entry point for the combined virt-mem executable. *)