Procenv 0.27 released

Procenv 0.27 has been released. This release introduces a raft of new features...

IPC

 It is now possible to display details of the following IPC mechanisms:

  • message queues
  • semaphores
  • shared memory
Alas, this feature is not available on BSD's as yet partly since there appears to be no documented way to query these mechanisms.

Output Categories


The introduction of the IPC categories brings the total number of output categories to 32:
  • meta
  • arguments
  • capabilities
  • cgroups
  • clocks
  • compiler
  • confstr
  • environment
  • file descriptors
  • libraries
  • limits
  • locale
  • misc
  • message queues
  • mounts
  • network
  • oom
  • platform
  • process
  • ranges
  • rusage
  • semaphores
  • shared memory
  • signals
  • sizeof
  • stat
  • sysconf
  • threads
  • time
  • timezone
  • tty
  • uname

Highly-Structured Output

The code that handles procenv has been completely rewritten so that all output is highly structured. So, rather than displaying file descriptors like this:

$ procenv --fds
fds:
  fd 0: terminal=yes ('/dev/pts/12')
  fd 1: terminal=no
  fd 2: terminal=yes ('/dev/pts/12')
fds (linux/proc):
  '/proc/self/fd/0' -> '/dev/pts/12' (terminal=yes, valid=yes)
  '/proc/self/fd/1' -> 'procenv.log' (terminal=no, valid=yes)
  '/proc/self/fd/2' -> '/dev/pts/12' (terminal=yes, valid=yes)

... they are now displayed like this:

$ procenv --fds
file descriptors:
  0:
    terminal: yes
    valid: yes
    device: /dev/pts/25
  1:
    terminal: no
    valid: yes
    device: procenv.log
  2:
    terminal: yes
    valid: yes
    device: /dev/pts/25

Note that not only is the output more structured, but for file-descriptor output there is now only a single section combining details of both the generic and Linux-specific details.

Format Version


Since it may be necessary to modify the output format, procenv now includes a format-version field in the meta section. This value (currently 1), will be incremented for each output format change. The format-version combined with the version of procenv itself should ease any version transition issues.

Tweaking the Output


If the default space indenting offends your sensibilities, you'll be glad to know that you can now change it to use tabs instead (or in fact any other character you choose):

--indent-char="\t"

Maybe you'd prefer 3 tab indents:

--indent-char="\t" --indent=3

Output Formats


The new highly-structured text output is in fact a side-effect of the fact that procenv can now produce output in other formats. The default is still text, but it can now produce JSON and XML. This even works when running --version:

$ procenv --version
0.27

$ procenv --format=json --version
{
  "version" : {
    "name" : "procenv",
    "version" : "0.27",
    "author" : "James Hunt <james.hunt@ubuntu.com>"
  }
}

$ procenv --format=xml --version
<?xml version="1.0" encoding="UTF-8"?>
<procenv version="0.27" package_string="procenv 0.27" mode="non-privileged" format_version="1">
  <section name="version">
    <entry name="name">procenv</entry>
    <entry name="version">0.27</entry>
    <entry name="author">James Hunt &lt;james.hunt@ubuntu.com&gt;</entry>
  </section>
</procenv>

This makes procenv output much more consumable by standard tools.

Crumbs!


However, the new highly-structured output introduces a problem. Before its introduction, it was easy to use grep(1) to extract particular values. But now, some of those values are on different lines. Yes, you can use the magic grep(1) options -A, -B and -C, but if that isn't convenient for you, procenv does offer an alternative in the form of an output format I've called "crumb" (short for "breadcrumb"). Here's the file descriptor output in breadcrumb output:

$ procenv --format=crumb --fds
file descriptors:0:terminal:yes
file descriptors:0:valid:yes
file descriptors:0:device:/dev/pts/25
file descriptors:1:terminal:yes
file descriptors:1:valid:yes
file descriptors:1:device:/dev/pts/25
file descriptors:2:terminal:yes
file descriptors:2:valid:yes
file descriptors:2:device:/dev/pts/25

As you can see, "crumb mode" shows every value with the appropriate sections the particular value belongs prior to the value. So the unique path to each value is shown by way of a list of "breadcrumbs" or headings. Thus, to extract all details of stdin (aka file descriptor zero):

$ procenv --format=crumb --fds | grep "^file descriptors:0"
file descriptors:0:terminal:yes
file descriptors:0:valid:yes
file descriptors:0:device:/dev/pts/25

It's also really easy to generate CSV data if you wanted to import the output into a spreadsheet:

$ procenv --format=crumb --crumb-separator=',' --separator=','

Download it from:

Comments

  1. Want to know, how to get the Roku activation code? Connect the hardware requisites, activate the network and as you proceed with the setup settings you can view the respective code on the screen. Note it down and type it visiting the url Roku.com/link to complete the activation.
    For more details contact the toll-free number @ +1-844-360-7450.

    ReplyDelete
  2. BigPond email login services go suitably for business and personal use. BigPond email login helps to delivering emailing and entertainment services to users. They provide services with help of experts there is list of services they provide like Entitlement to stay up-to-date with all your estimated call details and data usage , Ease to Pay bills , Effortless management of Pre-Paid bills , Set up Email invoice , Purchase movie tickets with BigPond .
    The expert are here to guide you and help you in every problems regarding BigPond email login . We are here to provide help you for 24x7 hour .

    ReplyDelete
  3. Bellsouth email support​ is the best widely reputed Email service provider. The organization provide services include like home telephone utility, cell phone utility, fast access internet services.
    Check out Bellsouth email support services for more details. The expert is here to guide you and help you with every problem regarding the BigPond email login. We are here to provide the help you 24x7 hours.

    ReplyDelete
  4. Brother Printer Support Number is one of the most renowned wireless printer's that many peoples uses, Nowadays, users are more interesting about wireless networks for printing their documents. So brother printer drivers provide many facilities to its users. For more information contact our experts they are 24*7 available to help their users.
    Brother Printer stuck in sleep mode | Brother Printer hl-2270dw Wireless Setup | Fix Brother Printer error code 214750003710

    ReplyDelete

Post a Comment

Popular posts from this blog

Byobu Bling with Unicode Custom Indicators

Procenv 0.46 - now with more platform goodness

Upstart User Sessions in Ubuntu Raring