Today’s Cool Toy of the Week is J-Core – the open implementation of SH cores. Jeff Dione, Rob Landley, and Rich Felker, along with a team of VHDL developers have been creating an open core implementation which can be run on a low-cost FPGA board, or processed to silicon using under-utilised fab’s without licensing fees.
My laptop has decided to find itself in the habit of waking up in the middle of the night. You’d think that as it’s nearly 2 now – it would have learnt to sleep right through – but no. It just won’t (always) sleep when it’s supposed to.
At times, I have put my HP to sleep, let it rest in my laptop back-pack – and having arrived at my destination – come to find that it has woken up, mid-transport – and has got itself all hot and bothered by being awake in a confined space. Not useful. Not good at all.
To start to track down this issue, we can look at /sys/kernel/debug/wakeup_sources, but I’m not interested in it’s current state. I’m interested in seeing the differences, and also determining when it is waking up. (Hours can go by in the night while I sleep myself of course)
To that end, I pulled together a quick and simple script to cp the wakeup_sources file, and store it in git. This gives me timestamps, of when the file is updated, and the ability to see the differences between each commit easily using the existing gitk/git diff tools.
# Obtain the latest debug content
cp /sys/kernel/debug/wakeup_sources .
# Then add and commit it to the git history, passing $* to the commit log
git add .
git commit -m "Update wakeup source file $*"
Simple but effective … when it is called at the right times! Having pm-utils installed, I believed I could link this script into /etc/pm/power.d, or sleep.d – however I hadn’t realised that systemd has now taken over my suspend resume script hooks – so PM-Utils is no longer effective here. (Leaving me confused as to why the directories are still there in my distribution, however I suspect they are remnants of upgrade cycles)
So, new-world-order suspend-resume scripts are still just as easy. Perhaps more so – as systemd does not use any c-like sorted ordering – but simply executes all scripts in /lib/systemd/system-sleep in parallel
With my script above linked in to the system-sleep directory, I now have automated logging in git – of the content changes to my wakeup_sources file. Hopefully I’ll be able to identify any patterns that arise from when the wakeups occur, or what the wakeup source actually was.
When sending patches to LKML, one should ensure that the patches have any maintainers on the To: line of the e-mails.
An effective way to ensure/automate this is to pass get_maintainer into git-send-email using the –to-cmd. git send-email patches/* --to-cmd 'scripts/get_maintainer.pl --no-git-fallback'
This automagically adds the appropriate e-mails and mailinglists to the e-mail targets for you!
It looks like git-send-email filters out the duplicates, which is also nice. The –no-git-fallback is needed, as otherwise get_maintainer.pl will add anyone who’s ever touched the file that you are modifying to the destination list!
What this means however is that the kernel will not mount the filesystem. Nor will it give you much reason; and considering you already know that your NFS Server is working (you can boot a real device after all) you will pull your hair out believing that the kernel running in the Qemu is misconfigured.
Not so – You need to tell your NFS server to be ‘insecure’; that is to allow it to accept connections from user based ports. Try something like the following