That newfangled Journal thing
That newfangled Journal thing
Posted Nov 21, 2011 18:23 UTC (Mon) by hanwen (subscriber, #4329)In reply to: That newfangled Journal thing by SEJeff
Parent article: That newfangled Journal thing
Posted Nov 21, 2011 18:58 UTC (Mon)
by khim (subscriber, #9252)
[Link] (3 responses)
Actually Google itself uses protobuffers for logging, but it'll not work outside of Google. The problem here is that protobuffers separate description of structure and the data. This means that you can not add new type of log without changing the protobuf definition. Works fine if all log types are kept in central repo (log reader just includes all possible log protobuffers from all possible programs), but will probably not work for wide world where you must handle logs from different, independently written programs.
Posted Nov 22, 2011 0:28 UTC (Tue)
by dashesy (guest, #74652)
[Link] (2 responses)
Another extension that would be interesting is a reverse .proto generator, where I can supply in my protocol structures header file and .proto is generated/updated based on the last release.
Posted Nov 22, 2011 8:25 UTC (Tue)
by khim (subscriber, #9252)
[Link] (1 responses)
Well, it should be possible, I'll grant you that. It'll require some scheme to keep all that in sync. Google itself does not have anything like that because they don't need it (centralized repo have it's advantages). Not sure what you meant by that. Why will you want to reverse-engineer .proto file? ProtoBuffers are intentionally limited, you can not just shove arbitrary structure in them...
Posted Nov 22, 2011 17:02 UTC (Tue)
by dashesy (guest, #74652)
[Link]
Maybe I should have rephrased my wish this way:
Protobuffers are not ideal for this, sadly...
Protobuffers seem very interesting! with APIs for C it should fit well with kernel logging as well.
Protobuffers are not ideal for this, sadly...
"but will probably not work for wide world where you must handle logs from different, independently written programs"
It seems you know better, but skimming through the docs (for my own validation) it seems there are extensions, so the log reader can have access to a generic definition (that comes with kernel) and independent programs can extend it. Sysadmins can install and (keep updated possibly through repos) the definitions for programs they care most.
Right, you can do it that way...
It seems you know better, but skimming through the docs (for my own validation) it seems there are extensions, so the log reader can have access to a generic definition (that comes with kernel) and independent programs can extend it. Sysadmins can install and (keep updated possibly through repos) the definitions for programs they care most.
Another extension that would be interesting is a reverse .proto generator, where I can supply in my protocol structures header file and .proto is generated/updated based on the last release.
Right, you can do it that way...
A gcc plugin that compiles .proto files directly will be very interesting.
Having Qt in mind, C lovers do not like to see not-exactly-C syntax in their code. Therefore a combination of limited (yes non-arbitrary) C structures and compiler pargmas (for example to specify that a field is optional, and what is the default) instead of .proto syntax, along with the above mentioned plugin will be even more attractive, and likely to be taken into kernel. Here I assumed kernel hackers love C, and I should confess I do not know how powerful gcc plugins are.