Diff of /daemon/opd_kernel.c [895e46] .. [29f0dd] Maximize Restore

  Switch to unified view

a/daemon/opd_kernel.c b/daemon/opd_kernel.c
...
...
5
 * @remark Copyright 2002 OProfile authors
5
 * @remark Copyright 2002 OProfile authors
6
 * @remark Read the file COPYING
6
 * @remark Read the file COPYING
7
 *
7
 *
8
 * @author John Levon
8
 * @author John Levon
9
 * @author Philippe Elie
9
 * @author Philippe Elie
10
 * Modified by Aravind Menon for Xen
11
 * These modifications are:
12
 * Copyright (C) 2005 Hewlett-Packard Co.
10
 */
13
 */
11
14
12
#include "opd_kernel.h"
15
#include "opd_kernel.h"
13
#include "opd_sfile.h"
16
#include "opd_sfile.h"
14
#include "opd_trans.h"
17
#include "opd_trans.h"
...
...
27
30
28
static LIST_HEAD(modules);
31
static LIST_HEAD(modules);
29
32
30
static struct kernel_image vmlinux_image;
33
static struct kernel_image vmlinux_image;
31
34
35
static struct kernel_image xen_image;
36
32
void opd_create_vmlinux(char const * name, char const * arg)
37
void opd_create_vmlinux(char const * name, char const * arg)
33
{
38
{
34
    /* vmlinux is *not* on the list of modules */
39
    /* vmlinux is *not* on the list of modules */
35
    list_init(&vmlinux_image.list);
40
    list_init(&vmlinux_image.list);
36
41
...
...
48
               vmlinux_image.start, vmlinux_image.end);
53
               vmlinux_image.start, vmlinux_image.end);
49
54
50
    if (!vmlinux_image.start && !vmlinux_image.end) {
55
    if (!vmlinux_image.start && !vmlinux_image.end) {
51
        fprintf(stderr, "error: mis-parsed kernel range: %llx-%llx\n",
56
        fprintf(stderr, "error: mis-parsed kernel range: %llx-%llx\n",
52
                vmlinux_image.start, vmlinux_image.end);
57
                vmlinux_image.start, vmlinux_image.end);
58
      exit(EXIT_FAILURE);
59
  }
60
}
61
62
void opd_create_xen(char const * name, char const * arg)
63
{
64
  /* xen is *not* on the list of modules */
65
  list_init(&xen_image.list);
66
67
  /* for no xen */
68
  if (no_xen) {
69
      xen_image.name = "no-xen";
70
      return;
71
  }
72
73
  xen_image.name = xstrdup(name);
74
75
  sscanf(arg, "%llx,%llx", &xen_image.start, &xen_image.end);
76
77
  verbprintf(vmisc, "xen_start = %llx, xen_end = %llx\n",
78
             xen_image.start, xen_image.end);
79
80
  if (!xen_image.start && !xen_image.end) {
81
      fprintf(stderr, "error: mis-parsed xen range: %llx-%llx\n",
82
              xen_image.start, xen_image.end);
53
        exit(EXIT_FAILURE);
83
        exit(EXIT_FAILURE);
54
    }
84
    }
55
}
85
}
56
86
57
87
...
...
190
        image = list_entry(pos, struct kernel_image, list);
220
        image = list_entry(pos, struct kernel_image, list);
191
        if (image->start <= trans->pc && image->end > trans->pc)
221
        if (image->start <= trans->pc && image->end > trans->pc)
192
            return image;
222
            return image;
193
    }
223
    }
194
224
225
  if (xen_image.start <= trans->pc && xen_image.end > trans->pc)
226
      return &xen_image;
227
195
    return NULL;
228
    return NULL;
196
}
229
}