<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->dtrd_action) {
+                        if (act == DTRACEACT_STACK) {
+                                int depth = rec->dtrd_arg;
+
+                                if (dt_print_stack(dtp, fp, NULL, addr, depth,
+                                 rec->dtrd_size / depth) < 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. The DTv1 code had this sequence of "if
(act==foo)" code blocks. I was simply trying to preserve some of
the structure of that code. Is that a good idea? Some people
will think so some of the time, and others... well. Anyhow, I
posted a v2 of that other patch. 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.
Sounds like you want everything in one big switch. Fine by me.
I'll do that. I just figured I'd explain why the code looked the
way it did.<br>
</blockquote>
<p>One other point. The code had been structured to look for
dt_print_*() functions for various actions, and then to look for
and handle ISPRINTFLIKE actions. That's why there was code for
actions like stack(), etc., and then for the printf-like stuff. 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>