blob: ff249d42d2dec953c2d51ea35b7be4cfccd285da [file] [log] [blame]
zra@google.comfd366da2014-02-24 19:28:30 +00001// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
Zachary Anderson103881d2016-10-26 00:26:03 -07005#ifndef RUNTIME_VM_PROCCPUINFO_H_
6#define RUNTIME_VM_PROCCPUINFO_H_
zra@google.comfd366da2014-02-24 19:28:30 +00007
8#include "vm/globals.h"
Zach Andersonf4074192021-07-02 19:06:45 +00009#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
zra@google.comfd366da2014-02-24 19:28:30 +000010
11#include "vm/allocation.h"
12
13namespace dart {
14
15class ProcCpuInfo : public AllStatic {
16 public:
Ben Konyi07852532018-09-28 23:18:59 +000017 static void Init();
zra@google.comfd366da2014-02-24 19:28:30 +000018 static void Cleanup();
19 static bool FieldContains(const char* field, const char* search_string);
20 static const char* ExtractField(const char* field);
21 static bool HasField(const char* field);
22
23 private:
24 static char* data_;
25 static intptr_t datalen_;
26
27 static char* FieldStart(const char* field);
28};
29
30} // namespace dart
31
Zach Andersonf4074192021-07-02 19:06:45 +000032#endif // defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
zra@google.comfd366da2014-02-24 19:28:30 +000033
Zachary Anderson103881d2016-10-26 00:26:03 -070034#endif // RUNTIME_VM_PROCCPUINFO_H_