Project

General

Profile

Actions

Feature #12773

closed

support CLOCK_THREAD_CPUTIME_ID and CLOCK_PROCESS_CPUTIME_ID

Added by Joshua M. Clulow about 2 years ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
kernel
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Linux provides two clock backends for reading what amounts to microstate accounting data from either the current LWP (CLOCK_THREAD_CPUTIME_ID) or the current process (CLOCK_PROCESS_CPUTIME_ID). Today, one would use getrusage(3C) to collect this information, with RUSAGE_SELF for the process or RUSAGE_LWP for the LWP.


Files

t2.c (4.18 KB) t2.c Dan McDonald, 2020-05-21 04:49 PM

Related issues

Is duplicate of illumos gate - Bug #14126: clock_gettime() could work with thread/proc clocksClosedRobert Mustacchi

Actions
Actions #1

Updated by Dan McDonald about 2 years ago

NOTE: LX has half-hearted emulation for this in SmartOS & OmniOSce, but a proper implementation of these two would go a long way toward source-portability for all-the-world's-Linux code.

Actions #2

Updated by Dan McDonald about 2 years ago

Attaching a larval toy test program that demonstrates differences between LX"s emulation and what happens on a platform that fully supports these clock IDs.

Actions #3

Updated by Andy Fiddaman 8 months ago

  • Is duplicate of Bug #14126: clock_gettime() could work with thread/proc clocks added
Actions #4

Updated by Electric Monk 7 months ago

  • Status changed from New to Closed

git commit dea9f5e6a4938723acec9624b3aa3f680f2f5c9f

commit  dea9f5e6a4938723acec9624b3aa3f680f2f5c9f
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2021-10-16T14:56:11.000Z

    14126 clock_gettime() could work with thread/proc clocks
    14139 Want libproc convenience function for lwpsinfo
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF