src/os/aix/vm/os_perf_aix.cpp

changeset 9907
35063c223567
parent 9858
b985cbb00e68
     1.1 --- a/src/os/aix/vm/os_perf_aix.cpp	Wed Apr 15 15:19:07 2020 +0200
     1.2 +++ b/src/os/aix/vm/os_perf_aix.cpp	Tue Apr 21 12:03:29 2020 +0200
     1.3 @@ -1,5 +1,6 @@
     1.4  /*
     1.5   * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2020 SAP SE. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -28,8 +29,7 @@
    1.11  #include "os_aix.inline.hpp"
    1.12  #include "runtime/os.hpp"
    1.13  #include "runtime/os_perf.hpp"
    1.14 -
    1.15 -#include CPU_HEADER(vm_version_ext)
    1.16 +#include "vm_version_ext_ppc.hpp"
    1.17  
    1.18  #include <stdio.h>
    1.19  #include <stdarg.h>
    1.20 @@ -179,32 +179,6 @@
    1.21  
    1.22  */
    1.23  
    1.24 -/**
    1.25 - * For platforms that have them, when declaring
    1.26 - * a printf-style function,
    1.27 - *   formatSpec is the parameter number (starting at 1)
    1.28 - *       that is the format argument ("%d pid %s")
    1.29 - *   params is the parameter number where the actual args to
    1.30 - *       the format starts. If the args are in a va_list, this
    1.31 - *       should be 0.
    1.32 - */
    1.33 -#ifndef PRINTF_ARGS
    1.34 -#  define PRINTF_ARGS(formatSpec,  params) ATTRIBUTE_PRINTF(formatSpec, params)
    1.35 -#endif
    1.36 -
    1.37 -#ifndef SCANF_ARGS
    1.38 -#  define SCANF_ARGS(formatSpec,   params) ATTRIBUTE_SCANF(formatSpec, params)
    1.39 -#endif
    1.40 -
    1.41 -#ifndef _PRINTFMT_
    1.42 -#  define _PRINTFMT_
    1.43 -#endif
    1.44 -
    1.45 -#ifndef _SCANFMT_
    1.46 -#  define _SCANFMT_
    1.47 -#endif
    1.48 -
    1.49 -
    1.50  struct CPUPerfTicks {
    1.51    uint64_t  used;
    1.52    uint64_t  usedKernel;
    1.53 @@ -234,7 +208,7 @@
    1.54  /** reads /proc/<pid>/stat data, with some checks and some skips.
    1.55   *  Ensure that 'fmt' does _NOT_ contain the first two "%d %s"
    1.56   */
    1.57 -static int SCANF_ARGS(2, 0) vread_statdata(const char* procfile, _SCANFMT_ const char* fmt, va_list args) {
    1.58 +static int vread_statdata(const char* procfile, const char* fmt, va_list args) {
    1.59    FILE*f;
    1.60    int n;
    1.61    char buf[2048];
    1.62 @@ -263,7 +237,7 @@
    1.63    return n;
    1.64  }
    1.65  
    1.66 -static int SCANF_ARGS(2, 3) read_statdata(const char* procfile, _SCANFMT_ const char* fmt, ...) {
    1.67 +static int read_statdata(const char* procfile, const char* fmt, ...) {
    1.68    int   n;
    1.69    va_list args;
    1.70  
    1.71 @@ -472,7 +446,7 @@
    1.72    return user_load;
    1.73  }
    1.74  
    1.75 -static int SCANF_ARGS(1, 2) parse_stat(_SCANFMT_ const char* fmt, ...) {
    1.76 +static int parse_stat(const char* fmt, ...) {
    1.77    FILE *f;
    1.78    va_list args;
    1.79  
    1.80 @@ -609,7 +583,7 @@
    1.81  
    1.82  CPUPerformanceInterface::CPUPerformance::~CPUPerformance() {
    1.83    if (_counters.cpus != NULL) {
    1.84 -    FREE_C_HEAP_ARRAY(char, _counters.cpus);
    1.85 +    FREE_C_HEAP_ARRAY(char, _counters.cpus, mtInternal);
    1.86    }
    1.87  }
    1.88  
    1.89 @@ -886,7 +860,7 @@
    1.90    cmdline = get_cmdline();
    1.91    if (cmdline != NULL) {
    1.92      process_info->set_command_line(allocate_string(cmdline));
    1.93 -    FREE_C_HEAP_ARRAY(char, cmdline);
    1.94 +    FREE_C_HEAP_ARRAY(char, cmdline, mtInternal);
    1.95    }
    1.96  
    1.97    return OS_OK;
    1.98 @@ -1011,12 +985,12 @@
    1.99    if (_cpu_info != NULL) {
   1.100      if (_cpu_info->cpu_name() != NULL) {
   1.101        const char* cpu_name = _cpu_info->cpu_name();
   1.102 -      FREE_C_HEAP_ARRAY(char, cpu_name);
   1.103 +      FREE_C_HEAP_ARRAY(char, cpu_name, mtInternal);
   1.104        _cpu_info->set_cpu_name(NULL);
   1.105      }
   1.106      if (_cpu_info->cpu_description() != NULL) {
   1.107         const char* cpu_desc = _cpu_info->cpu_description();
   1.108 -       FREE_C_HEAP_ARRAY(char, cpu_desc);
   1.109 +       FREE_C_HEAP_ARRAY(char, cpu_desc, mtInternal);
   1.110        _cpu_info->set_cpu_description(NULL);
   1.111      }
   1.112      delete _cpu_info;

mercurial