--
You received this message because you are subscribed to the Google Groups "Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akaros+un...@googlegroups.com.
To post to this group, send email to aka...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
files in Unix /proc have always been a mess. There are tables, tuples, tables and tuples, numbers, ... it's not consistent because it grew in pieces.This also covers other synthetics, since in the plan 9 model each driver offers its own tree, which is very different from the centralized /sys tree in linux. In plan 9, however, things are similarly inconsistent. Sometimes you get one line of numbers. Sometimes you get a thing that's like a table. Sometimes it's key value pairs. It's a mess. And, once a given file in the synthetic is changed, sometimes it's impossible to know how to read it.For synthetics that offer status, e.g. /net/tcp/*/status and so on, I'd like to propose something we did on Linux for the supercomputers that worked really well, and which is even used by HP to this day on their cluster offerings, though I know it's a tough sell: S-expressions.
S-expressions are handy because they are self-describing structures, trivial to process, and easy to merge (as we did in supermon, where we were merging 4500 such streams into one for cluster monitoring). Processing is insensitive to change: new components in the s-expression won't interfere with old processing pipelines.
So, taking linux meminfo as one example, it comes out like this today:MemTotal: xyz KBMemFree: zzz KB...S-expressions would look like this((MemTotal xyz) (MemFree xyz) ...)N.B.: the s-expression form can be just as compact, byte-wise, as the current form.I realize that linux has made a valiant effort in the last 10+ years to move non-process things to /sys and they've also enforced one value per file, but that has its own set of problems: you have one system call (minimum) per value. That's slow. For the monitor device we built for linux, we had about 100 values we could pull out at 12,000 hz. (30Khz on plan 9). This allowed us to see some useful artifacts with no measurable impact on the system: we could actually get a global picture of MPI reduce actions, for example, which were invisible with existing monitoring that could only watch at a fraction of a Hz. One value per file proved to be too slow.The software we used to parse this stuff is here: http://sexpr.sourceforge.net/it's small and fast.Before you ask: yes, we looked at XML. For whatever reason, XML parsers are big, complex, and slow. Matt and I moved to s-expressions after a frustrating couple of weeks working with XML. I don't know why, since XML is really just 'labelled s-expressions', but there you are. I think it's why XML has fallen out of favor in many places, in favor of other formats.
I'm not that wedded to s-expressions; any sort of self describing stream that allows for hierarchy (nesting) would be fine. JSON is one possibility.I like the fact that to process JSON data in Go I do this:import "encoding/json"and I'm done. It's why I used JSON for the build tool on Harvey; the parsing became Someone Else's Problem, and JSON was just good enough.
Anyway, I wanted to mention this before we got too far. I'd like to fix the synthetic file mess once and for all, and some sort of self-describing, uniform, nested format would be nice -- just don't say "XML" or my head will explode ...
--
Isn't it better to leave the kernel emitting JSON, and have a userspace "prettyfier" which could parse the JSON and emit eye-pleasing formats?
--On Fri, Oct 30, 2015 at 10:15 AM, ron minnich <rmin...@gmail.com> wrote:OK, barrett, good points. This is always the conflict between human readable and machine readable stuff, last seen in errno vs. errstr.So, we want- a standard format for programs that lets us read synthetic files with one libary, not thousands of little functions- human readable 'cat' output.Merging suggestions:- JSON format. There are good paths to serializing to other formats we might care about but no need to discuss them all here, right? :-)- human readable files. So, e.g., cat /proc/pid/status will give us what we have now- and, /proc/pid/status.json gives us jsonsound ok?ron--
You received this message because you are subscribed to the Google Groups "Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akaros+un...@googlegroups.com.
To post to this group, send email to aka...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akaros+un...@googlegroups.com.
To post to this group, send email to aka...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Isn't it better to leave the kernel emitting JSON, and have a userspace "prettyfier" which could parse the JSON and emit eye-pleasing formats?
On Friday, October 30, 2015, 'Davide Libenzi' via Akaros <aka...@googlegroups.com> wrote:Isn't it better to leave the kernel emitting JSON, and have a userspace "prettyfier" which could parse the JSON and emit eye-pleasing formats?This would be my vote too. You couldn't just cat it anymore to see the human readable format, but I'm ok with that, personally.
--ron
You received this message because you are subscribed to the Google Groups "Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akaros+un...@googlegroups.com.
To post to this group, send email to aka...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Friday, October 30, 2015, 'Davide Libenzi' via Akaros <aka...@googlegroups.com> wrote:Isn't it better to leave the kernel emitting JSON, and have a userspace "prettyfier" which could parse the JSON and emit eye-pleasing formats?This would be my vote too. You couldn't just cat it anymore to see the human readable format, but I'm ok with that, personally.
--
On Fri, Oct 30, 2015 at 1:56 PM, Kevin Klues <klu...@gmail.com> wrote:On Friday, October 30, 2015, 'Davide Libenzi' via Akaros <aka...@googlegroups.com> wrote:Isn't it better to leave the kernel emitting JSON, and have a userspace "prettyfier" which could parse the JSON and emit eye-pleasing formats?This would be my vote too. You couldn't just cat it anymore to see the human readable format, but I'm ok with that, personally.I'm scratching my head just a tad at the latter part of this statement; why wouldn't it be human readable? If I boot akaros right now and run:
/ $ cat /net/arpether OK 10.0.2.15 52:54:00:12:34:56/ $The format is pretty easily guessable, but is it any more readable than:{ dev: "ether", status: "OK", ip: "10.0.2.15", mac: "52:54:00:12:34:56" }?Similarly,/ $ cat '#proc/1/status'1 busybox WAITING 0/ $/ $Is that very different, than,{ pid: 1, name: "busybox", status: "WAITING", numtraps: 0 }?
--
You received this message because you are subscribed to the Google Groups "Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akaros+un...@googlegroups.com.
To post to this group, send email to aka...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
One thing of JSON is that is not TAB-ified. You *could* TAB-ify it, but that misses the point IMHO.If you have multiple records, that might not be so easy reading.Also, you example would be more like:{ "pid": 1, "name": "busybox", "status": "WAITING", "numtraps": 0 }Don't get me wrong, I like JSON, but I can see how people might find it not easy to read as son as it starts being not trivial.IMHO hte kernel should not be in the business of creating pretty output.That is what userspace is for ☺
That means that the kernel needs to have two functions to maintain now, to emit the same content.If you instead have the kernel always deal with JSON, and have a userspace script which is the gateway for your pretty viewing of internal status, things are tighter in the kernel, and a userspace tool have much more tooling to create pretty output, WRT the kernel.The other big advantage for JSON in general is that you can enrich the format (adding new fields) w/out breaking pretty-view readers.
I would have it always emit nonformatted Json and then run it through a standard prettifier at the time it is read.
One thing of JSON is that is not TAB-ified. You *could* TAB-ify it, but that misses the point IMHO.If you have multiple records, that might not be so easy reading.Also, you example would be more like:{ "pid": 1, "name": "busybox", "status": "WAITING", "numtraps": 0 }
Don't get me wrong, I like JSON, but I can see how people might find it not easy to read as son as it starts being not trivial.
IMHO hte kernel should not be in the business of creating pretty output.
That is what userspace is for ☺
On Fri, Oct 30, 2015 at 2:24 PM, 'Davide Libenzi' via Akaros <aka...@googlegroups.com> wrote:One thing of JSON is that is not TAB-ified. You *could* TAB-ify it, but that misses the point IMHO.If you have multiple records, that might not be so easy reading.Also, you example would be more like:{ "pid": 1, "name": "busybox", "status": "WAITING", "numtraps": 0 }Most JSON parsers don't *require* you to quote the key field (that is, it doesn't have to be a string). Consider the protobuf text format; it's billed as being compatible with JSON. If that's really a sticking point, then, I'd suggest that we formally use the protobuf text serialization format.
The protobuf is more readable IMO, but JSON is more a standard.
But, as I've got too much other stuff going on, I'm also not the one
who's going to code it up. I've said my piece on this, and I'll accept
code that does JSON or whatever for the various new status files.
So in summary:
- I'd like raw, console based, text output to work, at least for
existing interfaces
- I'd like clearly defined interfaces, especially if a machine is
processing the output (e.g. .protos in k/i/r/protos or something)
- Don't rule out protos for our long range IPC mechanisms (including
the kernel to user)
- I'm okay with JSON for now.
Barret
--
You received this message because you are subscribed to the Google Groups "Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akaros+un...@googlegroups.com.
To post to this group, send email to aka...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
you mean like a comment series that goes on for, oh, say, 35 patches and days:Comes with the territory :-)