Files
clear-linux-documentation/reference/manpages/telemetry.3.html
2024-11-04 18:56:31 +00:00

196 lines
11 KiB
HTML

<!DOCTYPE html>
<html lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>telemetry &#8212; Documentation for Clear Linux* project</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../_static/bizstyle.css?v=5283bb3d" />
<link rel="stylesheet" type="text/css" href="../../_static/copybutton.css?v=76b2166b" />
<script src="../../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../../_static/doctools.js?v=9bcbadda"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../../_static/copybutton.js?v=a56c686a"></script>
<script src="../../_static/bizstyle.js"></script>
<link rel="canonical" href="https://clearlinux.github.io/clear-linux-documentation/reference/manpages/telemetry.3.html" />
<link rel="icon" href="../../_static/favicon.ico"/>
<link rel="author" title="About these documents" href="../../about.html" />
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="Tutorial difficulty ratings" href="../tutorial-ratings.html" />
<link rel="prev" title="telemctl" href="telemctl.1.html" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<!--[if lt IE 9]>
<script src="_static/css3-mediaqueries.js"></script>
<![endif]-->
</head><body>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../tutorial-ratings.html" title="Tutorial difficulty ratings"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="telemctl.1.html" title="telemctl"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">Documentation for Clear Linux* project</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Reference</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../man-pages.html" accesskey="U">Man pages</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">telemetry</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="telemetry">
<h1>telemetry<a class="headerlink" href="#telemetry" title="Link to this heading"></a></h1>
<section id="c-programming-interface-for-telemetrics-client">
<h2>C programming interface for telemetrics-client<a class="headerlink" href="#c-programming-interface-for-telemetrics-client" title="Link to this heading"></a></h2>
<dl class="field-list simple">
<dt class="field-odd">Copyright<span class="colon">:</span></dt>
<dd class="field-odd"><p>(C) 2017 Intel Corporation, CC-BY-SA-3.0</p>
</dd>
<dt class="field-even">Manual section<span class="colon">:</span></dt>
<dd class="field-even"><p>3</p>
</dd>
</dl>
<section id="synopsis">
<h3>SYNOPSIS<a class="headerlink" href="#synopsis" title="Link to this heading"></a></h3>
<p><code class="docutils literal notranslate"><span class="pre">#include</span> <span class="pre">&quot;telemetry.h&quot;</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">struct</span> <span class="pre">telem_ref</span> <span class="pre">{</span> <span class="pre">struct</span> <span class="pre">telem_record</span> <span class="pre">*record;</span> <span class="pre">};</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">tm_create_record(struct</span> <span class="pre">telem_ref</span> <span class="pre">**t_ref,</span> <span class="pre">uint32_t</span> <span class="pre">severity,</span> <span class="pre">char</span> <span class="pre">*classification,</span> <span class="pre">uint32_t</span> <span class="pre">payload_version)</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">tm_set_payload(struct</span> <span class="pre">telem_ref</span> <span class="pre">*t_ref,</span> <span class="pre">char</span> <span class="pre">*payload)</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">tm_send_record(struct</span> <span class="pre">telem_ref</span> <span class="pre">*t_ref)</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">void</span> <span class="pre">tm_free_record(struct</span> <span class="pre">telem_ref</span> <span class="pre">*t_ref)</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">tm_set_config_file(const</span> <span class="pre">char</span> <span class="pre">*c_file)</span></code></p>
<p><code class="docutils literal notranslate"><span class="pre">int</span> <span class="pre">tm_is_opted_in(void)</span></code></p>
</section>
<section id="description">
<h3>DESCRIPTION<a class="headerlink" href="#description" title="Link to this heading"></a></h3>
<p>The functions in the telemetry library facilitate the delivery of
telemetry data to the <a class="reference external" href="telemprobd.1.html">telemprobd(1)</a> service.</p>
<p>The function <code class="docutils literal notranslate"><span class="pre">tm_create_record()</span></code> initializes a telemetry record and
sets the severity and classification of that record, as well as the
payload version number. The memory needed to store the telemetry record
is allocated and should be freed with <code class="docutils literal notranslate"><span class="pre">tm_free_record()</span></code> when no longer
needed.</p>
<p>The function <code class="docutils literal notranslate"><span class="pre">tm_set_payload()</span></code> attaches the provided telemetry record
data to the telemetry record. The current maximum payload size is 8192b.</p>
<p>The function <code class="docutils literal notranslate"><span class="pre">tm_send_record()</span></code> delivers the record to the local
<a class="reference external" href="telemprobd.1.html">telemprobd(1)</a> service.</p>
<p>The function <code class="docutils literal notranslate"><span class="pre">tm_set_config_file()</span></code> can be used to provide an alternate
configuration path to the telemetry library.</p>
<p><code class="docutils literal notranslate"><span class="pre">tm_is_opted_in</span></code> is a utility provided to check if the one time opt-in
has been performed.</p>
</section>
<section id="return-values">
<h3>RETURN VALUES<a class="headerlink" href="#return-values" title="Link to this heading"></a></h3>
<p>All these functions return <code class="docutils literal notranslate"><span class="pre">0</span></code> on success, or a non-zero return value
if an error occurred. The function <code class="docutils literal notranslate"><span class="pre">tm_free_record()</span></code> does not return
any value. <code class="docutils literal notranslate"><span class="pre">tm_is_opted_in</span></code> returns <code class="docutils literal notranslate"><span class="pre">1</span></code> when telemetry is opted-in
otherwise <code class="docutils literal notranslate"><span class="pre">0</span></code>.</p>
</section>
<section id="see-also">
<h3>SEE ALSO<a class="headerlink" href="#see-also" title="Link to this heading"></a></h3>
<ul class="simple">
<li><p><a class="reference external" href="telemprobd.1.html">telemprobd(1)</a></p></li>
<li><p><a class="reference external" href="https://github.com/clearlinux/telemetrics-client">https://github.com/clearlinux/telemetrics-client</a></p></li>
<li><p><a class="reference external" href="https://clearlinux.org/documentation/">https://clearlinux.org/documentation/</a></p></li>
</ul>
</section>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../index.html">
<img class="logo" src="../../_static/clearlinux.png" alt="Logo of Clear Linux* Project Docs"/>
</a></p>
<div>
<h3><a href="../../index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">telemetry</a><ul>
<li><a class="reference internal" href="#c-programming-interface-for-telemetrics-client">C programming interface for telemetrics-client</a><ul>
<li><a class="reference internal" href="#synopsis">SYNOPSIS</a></li>
<li><a class="reference internal" href="#description">DESCRIPTION</a></li>
<li><a class="reference internal" href="#return-values">RETURN VALUES</a></li>
<li><a class="reference internal" href="#see-also">SEE ALSO</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div>
<h4>Previous topic</h4>
<p class="topless"><a href="telemctl.1.html"
title="previous chapter">telemctl</a></p>
</div>
<div>
<h4>Next topic</h4>
<p class="topless"><a href="../tutorial-ratings.html"
title="next chapter">Tutorial difficulty ratings</a></p>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../../_sources/reference/manpages/telemetry.3.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../tutorial-ratings.html" title="Tutorial difficulty ratings"
>next</a> |</li>
<li class="right" >
<a href="telemctl.1.html" title="telemctl"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../../index.html">Documentation for Clear Linux* project</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Reference</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="../man-pages.html" >Man pages</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">telemetry</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2022 Intel Corporation. All Rights Reserved..
Last updated on Nov 04, 2024.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
</div>
</body>
</html>