Projects
home:Eustace:branches:Eulaceura:Factory
lxcfs
_service:obs_scm:0003-lxcfs-fix-cpuinfo-print.p...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0003-lxcfs-fix-cpuinfo-print.patch of Package lxcfs
From 735d69c8696b5ddc8090ad7906f07fe2fe5f9992 Mon Sep 17 00:00:00 2001 From: vegbir <yangjiaqi16@huawei.com> Date: Thu, 27 Jul 2023 07:00:28 +0000 Subject: [PATCH 03/15] lxcfs fix cpuinfo print Signed-off-by: vegbir <yangjiaqi16@huawei.com> --- src/proc_cpuview.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/proc_cpuview.c b/src/proc_cpuview.c index f5464de..76f8089 100644 --- a/src/proc_cpuview.c +++ b/src/proc_cpuview.c @@ -1051,7 +1051,17 @@ int proc_cpuinfo_read(char *buf, size_t size, off_t offset, } if (am_printing) { - l = snprintf(cache, cache_size, "%s", line); + if (strncmp(line, "physical id", 11) == 0) { + l = snprintf(cache, cache_size, "physical id : %d\n", curcpu); + } else if (strncmp(line, "siblings", 8) == 0) { + l = snprintf(cache, cache_size, "siblings : 1\n"); + } else if (strncmp(line, "core id", 7) == 0) { + l = snprintf(cache, cache_size, "core id : 0\n"); + } else if (strncmp(line, "cpu cores", 9) == 0) { + l = snprintf(cache, cache_size, "cpu cores : 1\n"); + } else { + l = snprintf(cache, cache_size, "%s", line); + } if (l < 0) return log_error(0, "Failed to write cache"); if ((size_t)l >= cache_size) -- 2.41.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2