github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/cpvmm/vmm/dbg/trace.h (about)

     1  /*
     2   * Copyright (c) 2013 Intel Corporation
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *     http://www.apache.org/licenses/LICENSE-2.0
     8   * Unless required by applicable law or agreed to in writing, software
     9   * distributed under the License is distributed on an "AS IS" BASIS,
    10   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    11   * See the License for the specific language governing permissions and
    12   * limitations under the License.
    13   */
    14  
    15  #ifndef TRACE_H
    16  #define TRACE_H
    17  
    18  #include "vmm_defs.h"
    19  
    20  #define MAX_TRACE_BUFFERS       1
    21  #define MAX_STRING_LENGTH       128
    22  #define MAX_RECORDS_IN_BUFFER   2048
    23  
    24  
    25  typedef struct {
    26      UINT64  tsc;
    27      UINT64  exit_reason;
    28      UINT64  guest_eip;
    29      char    string[MAX_STRING_LENGTH];
    30  } TRACE_RECORD_DATA;
    31  
    32  
    33  BOOLEAN trace_init( UINT32 max_num_guests, UINT32 max_num_guest_cpus);
    34  BOOLEAN trace_add_record( IN  UINT32  vm_index, IN  UINT32  cpu_index, IN  UINT32  buffer_index,
    35                   IN  TRACE_RECORD_DATA *data);
    36  BOOLEAN trace_remove_oldest_record( OUT UINT32 *vm_index, OUT UINT32 *cpu_index,
    37               OUT UINT32 *buffer_index, OUT UINT32 *record_index, OUT TRACE_RECORD_DATA *data);
    38  BOOLEAN trace_lock( void);
    39  BOOLEAN trace_unlock( void);
    40  void trace_set_recyclable(BOOLEAN recyclable);
    41  #endif // TRACE_H