RFR(M): 8020775: PPC64 (part 12): posix signal printing

Vladimir Kozlov vladimir.kozlov at oracle.com
Fri Jul 26 12:11:13 PDT 2013


I think it is good cleanup. Thank you, Goetz.

Few notes.

Could you align elements/names in tables in get_signal_name() and 
get_signal_code_description() to make them aligned with each other and 
with #ifdefs?

It looks like all unixes (including bsd) have NSIG value defined (I 
could be wrong). you can use it directly instead of MAX_SIGNAL_NUMBER. 
On Solaris it is:

/usr/include/sys/signal.h:#define	NSIG	73	/* valid signals range from 1 
to NSIG-1 */
/usr/include/sys/signal.h:#define	MAXSIG	72	/* size of u_signal[], 
NSIG-1 <= MAXSIG */

May be you can avoid #ifdef APPLE such way.

describe_signal_set_short() method is bogus. Why you overwrite buf[0] 
with "0" or "1" and the rest of buffer with 0 each time? Should it be 
And why you need separate describe_signal_set_short() method? And why 
you need *10 for buffer size? I would prefer to see the code similar to 
describe_sa_flags() with list of signals instead of "01". Yes, it would 
be different from current code but it would much more useful to have 
signal names.

In describe_sa_flags():

size_t remaining = size-1; // leave space for /0

Again, why you separated describe_sa_flags() method?

In get_signal_code_description():

Add break:

+  for (int i = 0; t1[i].sig != -1; i ++) {
+    if (t1[i].sig == si->si_signo && t1[i].code == si->si_code) {
+      s_code = t1[i].s_code;
+      s_desc = t1[i].s_desc;
+      break;
+    }
+  }
+

Put on different lines:

+    out->s_name = out->s_desc = "unknown";

Why not use s_name instead of s_code to match out->s_name?

Thanks,
Vladimir

On 7/25/13 4:11 PM, Lindenmaier, Goetz wrote:
> Hi,
>
> we'd like to contribute our posix signal printing.
> We implemented some routines to print signal and sa_flags information
> in the os/posix files, and call them from
> os::print_siginfo and print_signal_handler() in the various unix
> variant directories.
> The output is a bit more verbose than the existing version.
>
> We contribute this here, as our aix code uses this too.
>
> Please review this and test it if you think we should add this.
> We'd appreciate it.
> http://cr.openjdk.java.net/~goetz/webrevs/8020775-print_sig/
>
> Thanks and best regards,
>    Goetz.
>


More information about the ppc-aix-port-dev mailing list