<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>On 6/9/21 1:21 AM, Eugene Loh wrote:<br>
    </p>
    <blockquote type="cite" cite="mid:545c07eb-d17e-544e-1db4-753968ee3812@oracle.com">
      
      <p>On 6/9/21 12:43 AM, Kris Van Hees wrote:<br>
      </p>
      <blockquote type="cite" cite="mid:20210609044309.GS10024@oracle.com">
        <pre class="moz-quote-pre" wrap=""> Fri, May 28, 2021 at 02:35:09PM -0400, <a class="moz-txt-link-abbreviated" href="mailto:eugene.loh@oracle.com" moz-do-not-send="true">eugene.loh@oracle.com</a> wrote:
</pre>
      </blockquote>
      <blockquote type="cite" cite="mid:20210609044309.GS10024@oracle.com">
        <blockquote type="cite" style="color: #007cff;">
          <pre class="moz-quote-pre" wrap="">diff --git a/libdtrace/dt_consume.c b/libdtrace/dt_consume.c
@@ -2057,7 +2060,16 @@ dt_consume_one(dtrace_hdl_t *dtp, FILE *fp, char *buf,
                         if (rval != DTRACE_CONSUME_THIS)
                                 return dt_set_errno(dtp, EDT_BADRVAL);
 
-                        switch (rec-&gt;dtrd_action) {
+                        if (act == DTRACEACT_STACK) {
+                                int depth = rec-&gt;dtrd_arg;
+
+                                if (dt_print_stack(dtp, fp, NULL, addr, depth,
+                                    rec-&gt;dtrd_size / depth) &lt; 0)
+                                        return -1;
+                                continue;
+                        }
+
+                        switch (act) {
</pre>
        </blockquote>
        <blockquote type="cite" style="color: #007cff;"> </blockquote>
        <pre class="moz-quote-pre" wrap="">I truly do not understand why you put the DTRACEACT_STACK case outside the
switch, when it could just as easily be part of the switch.</pre>
      </blockquote>
      <br>
      You brought this up with respect to another patch as well, so I
      figured I'd explain.&nbsp; The DTv1 code had this sequence of &quot;if
      (act==foo)&quot; code blocks.&nbsp; I was simply trying to preserve some of
      the structure of that code.&nbsp; Is that a good idea?&nbsp; Some people
      will think so some of the time, and others... well.&nbsp; Anyhow, I
      posted a v2 of that other patch.&nbsp; The switch statement ends up
      impacting other patches and I propagated the change through.<br>
      <br>
      Now, the DTv1 code still had the PRINTF-LIKE actions separately.&nbsp;
      Sounds like you want everything in one big switch.&nbsp; Fine by me.&nbsp;
      I'll do that.&nbsp; I just figured I'd explain why the code looked the
      way it did.<br>
    </blockquote>
    <p>One other point.&nbsp; The code had been structured to look for
      dt_print_*() functions for various actions, and then to look for
      and handle ISPRINTFLIKE actions.&nbsp; That's why there was code for
      actions like stack(), etc., and then for the printf-like stuff.&nbsp; I
      had been trying to preserve that structure but, again, seems like
      you want it squashed together so that's what's happening.<br>
    </p>
  </body>
</html>