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

Switch to unified view

a/daemon/opd_trans.c b/daemon/opd_trans.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_trans.h"
15
#include "opd_trans.h"
13
#include "opd_kernel.h"
16
#include "opd_kernel.h"
14
#include "opd_sfile.h"
17
#include "opd_sfile.h"
...
...
217
     * kernel exit. See comments in opd_sfile.c
220
     * kernel exit. See comments in opd_sfile.c
218
     */
221
     */
219
}
222
}
220
223
221
224
222
static void code_kernel_exit(struct transient * trans)
225
static void code_user_enter(struct transient * trans)
223
{
226
{
224
    verbprintf(vmisc, "KERNEL_EXIT_SWITCH to user-space\n");
227
    verbprintf(vmisc, "USER_ENTER_SWITCH to user-space\n");
225
    trans->in_kernel = 0;
228
    trans->in_kernel = 0;
226
    clear_trans_current(trans);
229
    clear_trans_current(trans);
227
    clear_trans_last(trans);
230
    clear_trans_last(trans);
228
}
231
}
229
232
...
...
246
{
249
{
247
    verbprintf(varcs, "TRACE_BEGIN\n");
250
    verbprintf(varcs, "TRACE_BEGIN\n");
248
    trans->tracing = TRACING_START;
251
    trans->tracing = TRACING_START;
249
}
252
}
250
253
254
static void code_xen_enter(struct transient *trans)
255
{
256
  verbprintf(vmisc, "XEN_ENTER_SWITCH to xen\n");
257
  trans->in_kernel = 1;
258
  trans->current = NULL;
259
  /* subtlety: we must keep trans->cookie cached, even though it's 
260
   * meaningless for Xen - we won't necessarily get a cookie switch 
261
   * on Xen exit. See comments in opd_sfile.c. It seems that we can 
262
   * get away with in_kernel = 1 as long as we supply the correct 
263
   * Xen image, and its address range in startup find_kernel_image 
264
   * is modified to look in the Xen image also
265
   */
266
}
251
267
252
typedef void (*handler_t)(struct transient *);
268
typedef void (*handler_t)(struct transient *);
253
269
254
static handler_t handlers[LAST_CODE + 1] = {
270
static handler_t handlers[LAST_CODE + 1] = {
255
    &code_unknown,
271
    &code_unknown,
256
    &code_ctx_switch,
272
    &code_ctx_switch,
257
    &code_cpu_switch,
273
    &code_cpu_switch,
258
    &code_cookie_switch,
274
    &code_cookie_switch,
259
    &code_kernel_enter,
275
    &code_kernel_enter,
260
  &code_kernel_exit,
276
  &code_user_enter,
261
    &code_module_loaded,
277
    &code_module_loaded,
262
    /* tgid handled differently */
278
    /* tgid handled differently */
263
    &code_unknown,
279
    &code_unknown,
264
    &code_trace_begin,
280
    &code_trace_begin,
281
  &code_unknown,
282
  &code_xen_enter,
265
};
283
};
266
284
267
285
268
void opd_process_samples(char const * buffer, size_t count)
286
void opd_process_samples(char const * buffer, size_t count)
269
{
287
{

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks