As it turns out, readstr/readmem are not only used to copy to user memory, hence I had to add a check if the destination address is or not, within user land, and use the proper copy API.
On Tue, Dec 15, 2015 at 6:21 AM, Davide Libenzi <[email protected]> wrote: > Changed to emit NL. Cat to console is pretty ugly otherwise. > The raw data exported in build_info.c is raw though (no NL char at end). > > > On Tue, Dec 15, 2015 at 5:54 AM, Davide Libenzi <[email protected]> > wrote: > >> One question. Should we emit newline on those version strings? >> Currently, it is just the raw data. >> Linux does emit newline, at least in the most I tried. >> >> >> On Tue, Dec 15, 2015 at 5:50 AM, Davide Libenzi <[email protected]> >> wrote: >> >>> Branch updated for Ron's likings ☺ >>> >>> >>> On Mon, Dec 14, 2015 at 9:10 PM, Davide Libenzi <[email protected]> >>> wrote: >>> >>>> You got it Ron! :) >>>> >>>> >>>> On Dec 14, 2015, at 20:38, ron minnich <[email protected]> wrote: >>>> >>>> This is a pretty sweet device but I have a suggestion. Would it be >>>> possible to turn those variables (kernelpath, commitid, and so on) into >>>> symbols, something *equivalent* to this (I'm not saying this is the only >>>> way to do it): >>>> char *KernelPath = "whatever" >>>> and so on, i.e. just generate a C file full of such declarations, then >>>> in your device, you can, given the QID you get from the walk, on open, use >>>> QID.path to index into an array of pointers to those variables, then use >>>> the >>>> readstr >>>> func to copy the value out to user mode? >>>> >>>> This would avoid the need to parse the variables. Just an idea. >>>> >>>> If you're not liking the use of the QID.Path you could still maybe do >>>> this in a way that avoids searching for the : and so on. >>>> >>>> ron >>>> >>>> On Mon, Dec 14, 2015 at 8:33 PM 'Davide Libenzi' via Akaros < >>>> [email protected]> wrote: >>>> >>>>> As far as Akaros perf, I will append a new commit there. >>>>> I needed the kernel size also, in theory, but then it's like the dog >>>>> biting his tail 😀 >>>>> I don't know it until I am creating it. >>>>> But, I don't really need that. >>>>> Linux perf wants to know which ELF to use to look for symbols at a >>>>> given address, and I can assume from the kernel load address, up-a-while, >>>>> only the kernel ELF is there. >>>>> So I can just pass a relatively big number as size, and be done with >>>>> it. >>>>> >>>>> >>>>> >>>>> On Mon, Dec 14, 2015 at 8:28 PM, Davide Libenzi <[email protected]> >>>>> wrote: >>>>> >>>>>> The new machinery create an info file like: >>>>>> >>>>>> KernelPath: >>>>>> /usr/local/google/home/src/akaros/akaros/obj/kern/akaros-kernel-64b >>>>>> Date: Mon Dec 14 20:21:26 PST 2015 >>>>>> Host: dlibenzi.mtv.corp.google.com >>>>>> CommitID: 769cc0c093f9c9b9f41c6387d0272e317e0e62c3 >>>>>> >>>>>> And stick it into the kernel ELF file. >>>>>> The new device reads the information out into separate files (path, >>>>>> date, host, commit). >>>>>> This branch is based upon the devarch_msr_perf one. >>>>>> >>>>>> >>>>>> >>>>>> https://github.com/dlibenzi/akaros/compare/devarch_msr_perf...dlibenzi:build_info >>>>>> >>>>>> >>>>>> The following changes since commit >>>>>> b1e8b1a61a4e0493ef3605910477459fe30eaa43: >>>>>> >>>>>> Move Linux perf format conversion into perf tool, drop kprof2perf >>>>>> (2015-12-14 14:27:06 -0800) >>>>>> >>>>>> are available in the git repository at: >>>>>> >>>>>> [email protected]:dlibenzi/akaros build_info >>>>>> >>>>>> for you to fetch changes up to >>>>>> 25c241765f4395cd9ff910688c5f4afc91b8c2d1: >>>>>> >>>>>> Added #version device (2015-12-14 20:23:39 -0800) >>>>>> >>>>>> ---------------------------------------------------------------- >>>>>> Davide Libenzi (3): >>>>>> Added makefile machinary to generate a build info ELF section >>>>>> Added memstr() API to allow to search strings in memory >>>>>> Added #version device >>>>>> >>>>>> Makefile | 39 +++++++---- >>>>>> kern/drivers/dev/Kbuild | 1 + >>>>>> kern/drivers/dev/version.c | 157 >>>>>> +++++++++++++++++++++++++++++++++++++++++++++ >>>>>> kern/include/string.h | 1 + >>>>>> kern/src/strstr.c | 19 ++++++ >>>>>> 5 files changed, 203 insertions(+), 14 deletions(-) >>>>>> create mode 100644 kern/drivers/dev/version.c >>>>>> >>>>>> >>>>> -- >>>>> 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 [email protected]. >>>>> To post to this group, send email to [email protected]. >>>>> 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 [email protected]. >>>> To post to this group, send email to [email protected]. >>>> 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 [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
