openEuler inclusion
category: bugfix
bugzilla:
https://gitee.com/openeuler/kernel/issues/I4CIJQ
CVE: NA
This tool can help calculate the CPU idle rate in higher precision.
Signed-off-by: Hongyu Li <
543306408@qq.com>
---
tools/accounting/Makefile | 2 +-
tools/accounting/idle_cal.c | 91 +++++++++++++++++++++++++++++++++++++
2 files changed, 92 insertions(+), 1 deletion(-)
create mode 100644 tools/accounting/idle_cal.c
diff --git a/tools/accounting/Makefile b/tools/accounting/Makefile
index 03687f19cbb1..d14151e28173 100644
--- a/tools/accounting/Makefile
+++ b/tools/accounting/Makefile
@@ -2,7 +2,7 @@
CC := $(CROSS_COMPILE)gcc
CFLAGS := -I../../usr/include
-PROGS := getdelays
+PROGS := getdelays idle_cal
all: $(PROGS)
diff --git a/tools/accounting/idle_cal.c b/tools/accounting/idle_cal.c
new file mode 100644
index 000000000000..397b0fc1c69c
--- /dev/null
+++ b/tools/accounting/idle_cal.c
@@ -0,0 +1,91 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * idle_cal.c
+ *
+ * Copyright (C) 2007