Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ These scripts require KVM access and therefore must be executed on a host kernel
- Library calls fail with -1 unless otherwise stated, and `errno` is set.
- Quark returns pointers to internal state, which must not be modified and/or stored. In the case of multithreading, these pointers should not be accessed if another thread is driving quark through [quark\_queue\_get\_event(3)](https://elastic.github.io/quark/quark_queue_get_event.3.html).
- No threads are created, the library is driven solely through [quark\_queue\_get\_event(3)](https://elastic.github.io/quark/quark_queue_get_event.3.html).
- Access to a `quark_queue` must be synchronized by the user in the case of multithreading.
- Access to a `quark_queue` must be synchronized by the user in the case of multithreading. The boottime epoch is the exception: [quark\_update\_boottime(3)](https://elastic.github.io/quark/quark_update_boottime.3.html), [quark\_get\_boottime(3)](https://elastic.github.io/quark/quark_get_boottime.3.html) and [quark\_time\_to\_wallclock(3)](https://elastic.github.io/quark/quark_time_to_wallclock.3.html) may be called from any thread without synchronization.

# [BASIC USAGE](#BASIC_USAGE)

Expand Down Expand Up @@ -332,6 +332,18 @@ block for an unspecified amount of time.

basic queue statistics.

[quark\_time\_to\_wallclock(3)](https://elastic.github.io/quark/quark_time_to_wallclock.3.html)

translate a time since boot to wallclock.

[quark\_update\_boottime(3)](https://elastic.github.io/quark/quark_update_boottime.3.html)

refetch the boottime epoch after a system clock change.

[quark\_get\_boottime(3)](https://elastic.github.io/quark/quark_get_boottime.3.html)

get the boottime epoch.

[quark\_queue\_close(3)](https://elastic.github.io/quark/quark_queue_close.3.html)

close a queue.
Expand All @@ -346,7 +358,7 @@ close a queue.

# [SEE ALSO](#SEE_ALSO)

[quark\_event\_dump(3)](https://elastic.github.io/quark/quark_event_dump.3.html), [quark\_process\_iter(3)](https://elastic.github.io/quark/quark_process_iter.3.html), [quark\_process\_lookup(3)](https://elastic.github.io/quark/quark_process_lookup.3.html), [quark\_queue\_block(3)](https://elastic.github.io/quark/quark_queue_block.3.html), [quark\_queue\_close(3)](https://elastic.github.io/quark/quark_queue_close.3.html), [quark\_queue\_get\_epollfd(3)](https://elastic.github.io/quark/quark_queue_get_epollfd.3.html), [quark\_queue\_get\_event(3)](https://elastic.github.io/quark/quark_queue_get_event.3.html), [quark\_queue\_get\_stats(3)](https://elastic.github.io/quark/quark_queue_get_stats.3.html), [quark\_queue\_open(3)](https://elastic.github.io/quark/quark_queue_open.3.html), [quark-btf(8)](https://elastic.github.io/quark/quark-btf.8.html), [quark-mon(8)](https://elastic.github.io/quark/quark-mon.8.html), [quark-test(8)](https://elastic.github.io/quark/quark-test.8.html)
[quark\_event\_dump(3)](https://elastic.github.io/quark/quark_event_dump.3.html), [quark\_get\_boottime(3)](https://elastic.github.io/quark/quark_get_boottime.3.html), [quark\_process\_iter(3)](https://elastic.github.io/quark/quark_process_iter.3.html), [quark\_process\_lookup(3)](https://elastic.github.io/quark/quark_process_lookup.3.html), [quark\_queue\_block(3)](https://elastic.github.io/quark/quark_queue_block.3.html), [quark\_queue\_close(3)](https://elastic.github.io/quark/quark_queue_close.3.html), [quark\_queue\_get\_epollfd(3)](https://elastic.github.io/quark/quark_queue_get_epollfd.3.html), [quark\_queue\_get\_event(3)](https://elastic.github.io/quark/quark_queue_get_event.3.html), [quark\_queue\_get\_stats(3)](https://elastic.github.io/quark/quark_queue_get_stats.3.html), [quark\_queue\_open(3)](https://elastic.github.io/quark/quark_queue_open.3.html), [quark\_time\_to\_wallclock(3)](https://elastic.github.io/quark/quark_time_to_wallclock.3.html), [quark\_update\_boottime(3)](https://elastic.github.io/quark/quark_update_boottime.3.html), [quark-btf(8)](https://elastic.github.io/quark/quark-btf.8.html), [quark-mon(8)](https://elastic.github.io/quark/quark-mon.8.html), [quark-test(8)](https://elastic.github.io/quark/quark-test.8.html)

# [LICENSE](#LICENSE)

Expand Down
18 changes: 16 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,12 @@ <h1 class="Sh" id="CONVENTIONS"><a class="permalink" href="#CONVENTIONS">CONVENT
<li>No threads are created, the library is driven solely through
<a class="Xr" href="quark_queue_get_event.3.html">quark_queue_get_event(3)</a>.</li>
<li>Access to a <var class="Vt">quark_queue</var> must be synchronized by the
user in the case of multithreading.</li>
user in the case of multithreading. The boottime epoch is the exception:
<a class="Xr" href="quark_update_boottime.3.html">quark_update_boottime(3)</a>,
<a class="Xr" href="quark_get_boottime.3.html">quark_get_boottime(3)</a>
and
<a class="Xr" href="quark_time_to_wallclock.3.html">quark_time_to_wallclock(3)</a>
may be called from any thread without synchronization.</li>
Comment thread
biscout42 marked this conversation as resolved.
Resolved
</ul>
</section>
<section class="Sh">
Expand Down Expand Up @@ -412,6 +417,12 @@ <h1 class="Sh" id="API"><a class="permalink" href="#API">API</a></h1>
<dd>block for an unspecified amount of time.</dd>
<dt><a class="Xr" href="quark_queue_get_stats.3.html">quark_queue_get_stats(3)</a></dt>
<dd>basic queue statistics.</dd>
<dt><a class="Xr" href="quark_time_to_wallclock.3.html">quark_time_to_wallclock(3)</a></dt>
<dd>translate a time since boot to wallclock.</dd>
<dt><a class="Xr" href="quark_update_boottime.3.html">quark_update_boottime(3)</a></dt>
<dd>refetch the boottime epoch after a system clock change.</dd>
<dt><a class="Xr" href="quark_get_boottime.3.html">quark_get_boottime(3)</a></dt>
<dd>get the boottime epoch.</dd>
<dt><a class="Xr" href="quark_queue_close.3.html">quark_queue_close(3)</a></dt>
<dd>close a queue.</dd>
</dl>
Expand All @@ -430,6 +441,7 @@ <h1 class="Sh" id="FURTHER_READING"><a class="permalink" href="#FURTHER_READING"
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr" href="quark_event_dump.3.html">quark_event_dump(3)</a>,
<a class="Xr" href="quark_get_boottime.3.html">quark_get_boottime(3)</a>,
<a class="Xr" href="quark_process_iter.3.html">quark_process_iter(3)</a>,
<a class="Xr" href="quark_process_lookup.3.html">quark_process_lookup(3)</a>,
<a class="Xr" href="quark_queue_block.3.html">quark_queue_block(3)</a>,
Expand All @@ -438,6 +450,8 @@ <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
<a class="Xr" href="quark_queue_get_event.3.html">quark_queue_get_event(3)</a>,
<a class="Xr" href="quark_queue_get_stats.3.html">quark_queue_get_stats(3)</a>,
<a class="Xr" href="quark_queue_open.3.html">quark_queue_open(3)</a>,
<a class="Xr" href="quark_time_to_wallclock.3.html">quark_time_to_wallclock(3)</a>,
<a class="Xr" href="quark_update_boottime.3.html">quark_update_boottime(3)</a>,
<a class="Xr" href="quark-btf.8.html">quark-btf(8)</a>,
<a class="Xr" href="quark-mon.8.html">quark-mon(8)</a>,
<a class="Xr" href="quark-test.8.html">quark-test(8)</a></p>
Expand All @@ -454,7 +468,7 @@ <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1
</div>
<table class="foot">
<tr>
<td class="foot-date">June 16, 2025</td>
<td class="foot-date">August 14, 2026</td>
<td class="foot-os">Linux</td>
</tr>
</table>
Expand Down
18 changes: 16 additions & 2 deletions docs/quark.7.html
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,12 @@ <h1 class="Sh" id="CONVENTIONS"><a class="permalink" href="#CONVENTIONS">CONVENT
<li>No threads are created, the library is driven solely through
<a class="Xr" href="quark_queue_get_event.3.html">quark_queue_get_event(3)</a>.</li>
<li>Access to a <var class="Vt">quark_queue</var> must be synchronized by the
user in the case of multithreading.</li>
user in the case of multithreading. The boottime epoch is the exception:
<a class="Xr" href="quark_update_boottime.3.html">quark_update_boottime(3)</a>,
<a class="Xr" href="quark_get_boottime.3.html">quark_get_boottime(3)</a>
and
<a class="Xr" href="quark_time_to_wallclock.3.html">quark_time_to_wallclock(3)</a>
may be called from any thread without synchronization.</li>
</ul>
</section>
<section class="Sh">
Expand Down Expand Up @@ -412,6 +417,12 @@ <h1 class="Sh" id="API"><a class="permalink" href="#API">API</a></h1>
<dd>block for an unspecified amount of time.</dd>
<dt><a class="Xr" href="quark_queue_get_stats.3.html">quark_queue_get_stats(3)</a></dt>
<dd>basic queue statistics.</dd>
<dt><a class="Xr" href="quark_time_to_wallclock.3.html">quark_time_to_wallclock(3)</a></dt>
<dd>translate a time since boot to wallclock.</dd>
<dt><a class="Xr" href="quark_update_boottime.3.html">quark_update_boottime(3)</a></dt>
<dd>refetch the boottime epoch after a system clock change.</dd>
<dt><a class="Xr" href="quark_get_boottime.3.html">quark_get_boottime(3)</a></dt>
<dd>get the boottime epoch.</dd>
<dt><a class="Xr" href="quark_queue_close.3.html">quark_queue_close(3)</a></dt>
<dd>close a queue.</dd>
</dl>
Expand All @@ -430,6 +441,7 @@ <h1 class="Sh" id="FURTHER_READING"><a class="permalink" href="#FURTHER_READING"
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr" href="quark_event_dump.3.html">quark_event_dump(3)</a>,
<a class="Xr" href="quark_get_boottime.3.html">quark_get_boottime(3)</a>,
<a class="Xr" href="quark_process_iter.3.html">quark_process_iter(3)</a>,
<a class="Xr" href="quark_process_lookup.3.html">quark_process_lookup(3)</a>,
<a class="Xr" href="quark_queue_block.3.html">quark_queue_block(3)</a>,
Expand All @@ -438,6 +450,8 @@ <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
<a class="Xr" href="quark_queue_get_event.3.html">quark_queue_get_event(3)</a>,
<a class="Xr" href="quark_queue_get_stats.3.html">quark_queue_get_stats(3)</a>,
<a class="Xr" href="quark_queue_open.3.html">quark_queue_open(3)</a>,
<a class="Xr" href="quark_time_to_wallclock.3.html">quark_time_to_wallclock(3)</a>,
<a class="Xr" href="quark_update_boottime.3.html">quark_update_boottime(3)</a>,
<a class="Xr" href="quark-btf.8.html">quark-btf(8)</a>,
<a class="Xr" href="quark-mon.8.html">quark-mon(8)</a>,
<a class="Xr" href="quark-test.8.html">quark-test(8)</a></p>
Expand All @@ -454,7 +468,7 @@ <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1
</div>
<table class="foot">
<tr>
<td class="foot-date">June 16, 2025</td>
<td class="foot-date">August 14, 2026</td>
<td class="foot-os">Linux</td>
</tr>
</table>
Expand Down
84 changes: 84 additions & 0 deletions docs/quark_get_boottime.3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<title>QUARK_GET_BOOTTIME(3)</title>
</head>
<body>
<table class="head">
<tr>
<td class="head-ltitle">QUARK_GET_BOOTTIME(3)</td>
<td class="head-vol">Library Functions Manual</td>
<td class="head-rtitle">QUARK_GET_BOOTTIME(3)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">quark_get_boottime</code> &#x2014;
<span class="Nd">get the boottime epoch used for wallclock
translation</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
&lt;<a class="In">quark.h</a>&gt;</code></p>
<p class="Pp"><var class="Ft">u64</var>
<br/>
<code class="Fn">quark_get_boottime</code>(<var class="Fa" style="white-space: nowrap;">void</var>);</p>
</section>
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<code class="Nm">quark_get_boottime</code> returns the internal boottime epoch:
the wallclock time of boot in nanoseconds since the Unix epoch, as fetched
from the btime field of <span class="Pa">/proc/stat</span>. btime has a
resolution of one second.
<p class="Pp">The epoch is fetched when the first queue is opened and refetched
only by
<a class="Xr" href="quark_update_boottime.3.html">quark_update_boottime(3)</a>.
It is what
<a class="Xr" href="quark_time_to_wallclock.3.html">quark_time_to_wallclock(3)</a>
adds to a time since boot, exposed for users that prefer to do the
translation themselves.</p>
<section class="Sh">
<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
VALUES</a></h1>
<p class="Pp">The boottime epoch in nanoseconds since the Unix epoch, zero if a
queue was never opened.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr" href="quark_event_dump.3.html">quark_event_dump(3)</a>,
<a class="Xr" href="quark_process_iter.3.html">quark_process_iter(3)</a>,
<a class="Xr" href="quark_process_lookup.3.html">quark_process_lookup(3)</a>,
<a class="Xr" href="quark_queue_block.3.html">quark_queue_block(3)</a>,
<a class="Xr" href="quark_queue_close.3.html">quark_queue_close(3)</a>,
<a class="Xr" href="quark_queue_default_attr.3.html">quark_queue_default_attr(3)</a>,
<a class="Xr" href="quark_queue_get_epollfd.3.html">quark_queue_get_epollfd(3)</a>,
<a class="Xr" href="quark_queue_get_event.3.html">quark_queue_get_event(3)</a>,
<a class="Xr" href="quark_queue_get_stats.3.html">quark_queue_get_stats(3)</a>,
<a class="Xr" href="quark_queue_open.3.html">quark_queue_open(3)</a>,
<a class="Xr" href="quark_time_to_wallclock.3.html">quark_time_to_wallclock(3)</a>,
<a class="Xr" href="quark_update_boottime.3.html">quark_update_boottime(3)</a>,
<a class="Xr" href="quark.7.html">quark(7)</a>,
<a class="Xr" href="quark-btf.8.html">quark-btf(8)</a>,
<a class="Xr" href="quark-mon.8.html">quark-mon(8)</a>,
<a class="Xr" href="quark-test.8.html">quark-test(8)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp"><code class="Nm">quark_get_boottime</code> appeared in quark 0.8,
when all times handed out by quark switched from nanoseconds since the Unix
epoch to nanoseconds since boot.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">August 5, 2026</td>
<td class="foot-os">Linux</td>
</tr>
</table>
</body>
</html>
6 changes: 4 additions & 2 deletions docs/quark_queue_open.3.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIP
opened queue's <i class="Em">flags</i> when its event times are
CLOCK_MONOTONIC instead of CLOCK_BOOTTIME, which only the KPROBE
backend does. Monotonic times undercount by the total suspended time,
users that care about suspend must compensate.</dd>
users that care about suspend must compensate. See
<a class="Xr" href="quark_time_to_wallclock.3.html">quark_time_to_wallclock(3)</a>
for the effect on wallclock translation.</dd>
<dt id="QQ_THREAD_EVENTS"><a class="permalink" href="#QQ_THREAD_EVENTS"><code class="Dv">QQ_THREAD_EVENTS</code></a></dt>
<dd>Include per-thread events, instead of per-process events. This option
will be removed in the future, but it may be useful for
Expand Down Expand Up @@ -170,7 +172,7 @@ <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
</div>
<table class="foot">
<tr>
<td class="foot-date">August 6, 2026</td>
<td class="foot-date">August 14, 2026</td>
<td class="foot-os">Linux</td>
</tr>
</table>
Expand Down
Loading