<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style='--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;'>
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>
<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>
<style>img {
max-width: 100%; height: auto;
}
body {
font-size: .875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px;
}
body {
font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px; font-family: "GitLab Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans",Ubuntu,Cantarell,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";'>
<div class="content">
<div style="color: #333333; border-bottom-width: 8px; border-bottom-color: #ededed; border-bottom-style: solid; font-weight: bold; line-height: 1.4; padding: 20px 0;">
Merge request <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339">!339</a> was reviewed by <a href="https://gitlab.rtems.org/joel">Joel Sherrill</a>
</div>
<p style="color: #777777;">
<a href="https://gitlab.rtems.org/joel">Joel Sherrill</a>
commented on a
discussion on <a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339#note_119728">cpukit/rtems/src/clockgettod.c</a>:
</p>
<table class="code gl-mb-5" style="border-spacing: 0; margin-bottom: 1rem; border-collapse: collapse; width: auto; font-family: monospace; font-size: 90%;" bgcolor="#ffffff" width="100%" cellpadding="0" cellspacing="0">
<tr class="line_holder old" style="line-height: 1.6;">
<td class="old_line diff-line-num old" data-linenumber="145" style="width: 35px; color: rgba(5,5,6,.24); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: inherit;" align="right" bgcolor="#f9d7dc">
145
</td>
<td class="new_line diff-line-num old" data-linenumber="66" style="width: 35px; color: rgba(5,5,6,.24); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: inherit;" align="right" bgcolor="#f9d7dc">
</td>
<td class="line_content old" style="padding: inherit;" bgcolor="#fbe9eb"><pre style='display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: inherit; border-radius: 2px; margin: 0; padding: 0; border: inherit solid #dcdcde;'>-<span id="LC145" class="line" lang="c"> <span class="p">}</span></span>
</pre></td>
</tr>
<tr class="line_holder old" style="line-height: 1.6;">
<td class="old_line diff-line-num old" data-linenumber="146" style="width: 35px; color: rgba(5,5,6,.24); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: inherit;" align="right" bgcolor="#f9d7dc">
146
</td>
<td class="new_line diff-line-num old" data-linenumber="66" style="width: 35px; color: rgba(5,5,6,.24); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: inherit;" align="right" bgcolor="#f9d7dc">
</td>
<td class="line_content old" style="padding: inherit;" bgcolor="#fbe9eb"><pre style='display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: inherit; border-radius: 2px; margin: 0; padding: 0; border: inherit solid #dcdcde;'>-<span id="LC146" class="line" lang="c"> <span class="p">}</span></span>
</pre></td>
</tr>
<tr class="line_holder new" style="line-height: 1.6;">
<td class="old_line diff-line-num new" data-linenumber="147" style="width: 35px; color: rgba(5,5,6,.24); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: inherit;" align="right" bgcolor="#ddfbe6">
</td>
<td class="new_line diff-line-num new" data-linenumber="66" style="width: 35px; color: rgba(5,5,6,.24); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: inherit;" align="right" bgcolor="#ddfbe6">
66
</td>
<td class="line_content new" style="padding: inherit;" bgcolor="#ecfdf0"><pre style='display: block; font-size: 14px; color: #28272d; position: relative; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; word-break: break-all; word-wrap: break-word; background-color: inherit; border-radius: 2px; margin: 0; padding: 0; border: inherit solid #dcdcde;'>+<span id="LC66" class="line" lang="c"> <span class="n" style="color: #333333;">current_time_tm</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333333;">gmtime_r</span><span class="p">(</span> <span class="o" style="font-weight: 600;">&</span><span class="n" style="color: #333333;">now</span><span class="p">.</span><span class="n" style="color: #333333;">tv_sec</span><span class="p">,</span> <span class="o" style="font-weight: 600;">&</span><span class="n" style="color: #333333;">buf</span> <span class="p">);</span></span>
</pre></td>
</tr>
</table>
<div class="md" style="border-bottom-width: 4px; border-bottom-color: #ededed; border-bottom-style: solid; padding-bottom: 1em; position: relative; z-index: 1; color: #28272d; word-wrap: break-word;">
<p dir="auto" style="color: #28272d; margin: 0;" align="initial">This looks like a good idea. Whether the implementation of gmtime_r() returns an error is independent of us checking it. Static analysers will notice.</p>
</div>
<p style="color: #777777;">
<a href="https://gitlab.rtems.org/joel">Joel Sherrill</a>
commented on a
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339#note_119729">discussion</a>:
</p>
<div class="md" style="border-bottom-width: 4px; border-bottom-color: #ededed; border-bottom-style: solid; padding-bottom: 1em; position: relative; z-index: 1; color: #28272d; word-wrap: break-word;">
<p dir="auto" style="color: #28272d; margin: 0;" align="initial"><a href="https://gitlab.rtems.org/zakthertemsdev" data-reference-type="user" data-user="52" data-container="body" data-placement="top" class="gfm gfm-project_member js-user-link" title="zack liang" style="color: #0b5cad; background-color: #cbe2f9; border-radius: .25rem; margin-top: 0; padding: 0 2px;">@zakthertemsdev</a> Can you add test checks that every field in the returned structure has the expected value? I agree with <a href="https://gitlab.rtems.org/gedare" data-reference-type="user" data-user="8" data-container="body" data-placement="top" class="gfm gfm-project_member js-user-link" title="Gedare Bloom" style="color: #0b5cad; background-color: #cbe2f9; border-radius: .25rem; padding: 0 2px;">@gedare</a> that this is a test deficiency.</p>
</div>
<p style="color: #777777;">
<a href="https://gitlab.rtems.org/joel">Joel Sherrill</a>
commented on a
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339#note_119730">discussion</a>:
</p>
<div class="md" style="border-bottom-width: 4px; border-bottom-color: #ededed; border-bottom-style: solid; padding-bottom: 1em; position: relative; z-index: 1; color: #28272d; word-wrap: break-word;">
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">We have tm08 which can be used to measure the before and after time impact.</p>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">The size impact can be done by seeing what the size is of a relocatable with rtems_clock_get_tod undefined and linking against librtemscpu.a and the appropriate libc.a. I had this m68k BSP built from trying to remove warnings. This is what I tried:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true" style="display: block; font-size: 90%; color: #28272d; line-height: 1.6em; overflow-x: auto; border-radius: .25rem; position: relative; font-family: monospace; word-break: break-all; word-wrap: break-word; background-color: #ffffff; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 100%; margin: 0 0 16px; padding: 12px; border: 1px solid #dcdcde;"><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: .25rem; white-space: pre; margin-top: 0; font-family: "GitLab Mono","JetBrains Mono","Menlo","DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace; vertical-align: bottom; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">$ sh -x /tmp/x3</span>
<span id="LC2" class="line" lang="plaintext">+ m68k-rtems7-ld -r -o file.rel --undefined=rtems_clock_get_tod /home/joel/rtems-work/rtems/b-COBRA5475/m68k/COBRA5475/librtemscpu.a /home/joel/rtems-work/tools/7/m68k-rtems7/lib/m5475/libc.a</span>
<span id="LC3" class="line" lang="plaintext">+ m68k-rtems7-size file.rel</span>
<span id="LC4" class="line" lang="plaintext"> text data bss dec hex filename</span>
<span id="LC5" class="line" lang="plaintext"> 41186 260 1209 42655 a69f file.rel</span></code></pre>
<copy-code></copy-code><insert-code-snippet></insert-code-snippet>
</div>
<p dir="auto" style="color: #28272d; margin: 0 0 16px;" align="initial">Using nm, it looks like the call into the score results in more coming in than the TOD conversion.</p>
<p dir="auto" style="color: #28272d; margin: 0;" align="initial"><a href="https://gitlab.rtems.org/zakthertemsdev" data-reference-type="user" data-user="52" data-container="body" data-placement="top" class="gfm gfm-project_member js-user-link" title="zack liang" style="color: #0b5cad; background-color: #cbe2f9; border-radius: .25rem; margin-top: 0; padding: 0 2px;">@zakthertemsdev</a> What BSP are you using? I can do the before and you the after data if <a href="https://gitlab.rtems.org/gedare" data-reference-type="user" data-user="8" data-container="body" data-placement="top" class="gfm gfm-project_member js-user-link" title="Gedare Bloom" style="color: #0b5cad; background-color: #cbe2f9; border-radius: .25rem; padding: 0 2px;">@gedare</a> and <a href="https://gitlab.rtems.org/chris" data-reference-type="user" data-user="3" data-container="body" data-placement="top" class="gfm gfm-project_member js-user-link" title="Chris Johns" style="color: #0b5cad; background-color: #cbe2f9; border-radius: .25rem; padding: 0 2px;">@chris</a> are ok with this approach. I don't know what else could be gathered.</p>
</div>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #737278;">
—
<br>
<a href="https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339">View it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.rtems.org">gitlab.rtems.org</a>. <a href="https://gitlab.rtems.org/-/sent_notifications/b3f7e51689cc9d34afcaadfbe3d64bbb/unsubscribe" target="_blank" rel="noopener noreferrer">Unsubscribe</a> from this thread · <a href="https://gitlab.rtems.org/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.rtems.org/help" target="_blank" rel="noopener noreferrer" class="help-link">Help</a>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Merge request","url":"https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/339"}}</script>
</p>
</div>
</body>
</html>