UDOO performance counter kernel module

Discussion in 'Kernels' started by javawolfpack, Jun 11, 2014.

  1. javawolfpack

    javawolfpack New Member

    Joined:
    Jun 1, 2014
    Messages:
    8
    Likes Received:
    0
    So to start I posted over in the linux ubuntu thread about this; however, think this is more specifically a kernel/hardware level question that might be better served here. But here's a link to my original thread:

    program-execution-timer-cycle-count-timer-for-udoo-linux-t1453.html

    I had an article there that discussed the PMCR, CCR, CR0 and CR1 access via the ARM MRC and MCR instructions. I've since been linked to an article with source for a kernel module on the raspberry-pi to get access to these cycle count assembly features:

    http://sandsoftwaresound.net/raspberry- ... el-module/

    I'm not sure if that would even be compatible; however, to even begin to try and build them and try I would need to get kernel headers. This was asked in a previous posting here:

    matching-kernel-headers-for-armel-t800.html

    However, they never really discussed how they eventually solved their problem and there was no follow up in terms of a step-by-step tutorial of how to get the headers installed/linked correctly.

    Anyway, if anyone has had success with the perf cycle counters and is willing to let me know how they got them working that would be ideal, but if not either thoughts on if the raspberry-pi code would likely work and how to get the kernel headers for the OS version I'm running would be greatly appreciated:

    Linux udoobuntu 3.0.35 #2 SMP PREEMPT Tue May 27 15:36:22 CEST 2014 armv7l armv7l armv7l GNU/Linux
     
  2. mikelangeloz

    mikelangeloz Member

    Joined:
    Jul 9, 2013
    Messages:
    129
    Likes Received:
    1
    The kernel headers are in the github repo, with the kernel sources:
    https://github.com/UDOOboard/Kernel_Unico

    To correctly link em, just create two symlinks in /lib/modules/3.0.35

    ln -s /pathtoclonedgitrepo/linux/source
    ln -s /pathtoclonedgitrepo/linux/build

    I may recall the paths wrong, but this is basically what you have to do. Let me know
     
  3. javawolfpack

    javawolfpack New Member

    Joined:
    Jun 1, 2014
    Messages:
    8
    Likes Received:
    0
    Thanks, grabbing now hopefully won't run into problems.
     
  4. javawolfpack

    javawolfpack New Member

    Joined:
    Jun 1, 2014
    Messages:
    8
    Likes Received:
    0
    There doesn't appear to be a linux folder anywhere in the git repo. So the two symlinks mentioned won't work. I've followed the following with the Linaro Ubuntu 11.10 image as ran into issues with it compiling on the 12.04 image. But not sure how to use the results to build my own kernel module... Thoughts would be extremely helpful.

    http://www.udoo.org/forum/ubuntu-kernel-won-compile-t881.html
     
  5. javawolfpack

    javawolfpack New Member

    Joined:
    Jun 1, 2014
    Messages:
    8
    Likes Received:
    0
    Ok got the kernel compiled, got a kernel module built/installed/running.

    Issue is that it only enables the CCNT registers for 1/4 cores. Anyone have thoughts on how to get it enabled on the other 3? Or enable linux kernel modules on a cores specific fashion?
     
  6. javawolfpack

    javawolfpack New Member

    Joined:
    Jun 1, 2014
    Messages:
    8
    Likes Received:
    0
    I solved this by having the kernel module launch kernel threads with core affinity. If I get a moment will put all the steps I took here to get it fully working including kernel module source.
     

Share This Page