11128 SPARC build fails for sun4v picl snmp plugin

Review Request #1919 — Created June 1, 2019 and submitted

A SPARC build fails with:
; /export/home/ptribble/Illumos/topo-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/ctfconvert -L VERSION pics/debug.o
ctfconvert: file does not contain DWARF data

    Error code 1
    dmake: Warning: Command failed for target `pics/debug.o'
    Current working directory /export/home/ptribble/Illumos/topo-gate/usr/src/cmd/picl/plugins/sun4v/lib/snmp

Looking at the code, it may be cleaner to remove the SNMP_DEBUG pieces entirely, so the fix here does just that.

With the fix, this build error is no longer present.

  1. it is very bad practice to remove debug code. you just can disable it. but do not remove. my -1

    1. The problem is that this code is disabled. It requires someone to go in and manually enable it, it's likely that it's never been built or run by an illumos user, and the Makefile warns against enabling it.

    2. leave debug code as is - it can help enabel it if you need debug. many places in different platforms to do it. with debug, we try to inject additional code, but existen can help identify places where it was and use it if needed.
      for example: on DilOS we do separate userland components build with GDB flags and do it by separate Makefile.gnu - no conflicts with dmake.

    3. Igor has a point. Debug code like that can be helpful to have around.

      Also, I think there's probably a much simpler way to fix this, which is to
      arrange that the debug.o produced has something in it that will generate some CTF.
      It doesn't have to be anything that will actually be used. It just has to make the .o non-empty.
      I haven't tried, but I suspect that approach could fix this bug without nearly so much change.

    4. we have dtrace to inspect things.

    5. The code will be kept around, forever. All you have to do is look back through the history in whatever source code management system is in use.

      Again, there is no evidence whatsoever that this debug code has ever been compiled, let alone used. It's just dead. In the event that debugging were required in this area, then one could resurrect the code or, more likely, inject custom debugging code relevant to the problem being investigated.

  1. Dead code should be gone.

  1. Ship It!
Review request changed

Status: Closed (submitted)