Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine whether a hardware or a software watchdog is implemented on the machine?

I have an embedded computer I am trying to develop on and I wanted to know if the watchdog it has is a software watchdog or if it is a hardware watchdog.

First I checked and I saw that /dev/watchdog is present inside /dev. But I did not see a watchdog process when I issued ps. So I installed a watchdog daemon (or driver?) and verified that a watchdog is running, again I used ps.

My problem now is I have no idea whether this is a hardware or software watchdog... there is a .conf file and also a process called /usr/sbin/watchdog owned by root. In case that info helps.

TIA!

Niko


The dmidecode does NOT show the watchdog information on this machine, whereas it does show watchdog present info on my peer's laptop:

On the other hand on my computer the /dev folder is NOT showing the watchdog entry nor does lsmod|grep softdog show anything.

From here: http://www.sat.dundee.ac.uk/psc/watchdog/watchdog-testing.html

Checking for the Watchdog Hardware If you have successfully loaded the watchdog hardware's driver module (or the 'softdog' > emulator) then you should see the entry in /dev corresponding to this. For example:

ls -l /dev/watch*
crw------- 1 root root 10, 130 May 13 16:27 /dev/watchdog

I need to know which module do I need to load for hardware watchdog and for that I need to know what module does my hardware watchdog require!

One board I have is: CAPA830 with Ubuntu 12.04 on it
and other is:
3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

dmesg on the second machine shows:
NMI watchdog: enabled on all CPUs, permanently consumes one hw-PMU counter.

like image 842
nemo Avatar asked Jun 04 '14 23:06

nemo


2 Answers

If you are talking about Linux's software watchdog then softdog module should be loaded, which you can verify with

$lsmod|grep softdog
softdog                13319  0 
like image 73
auselen Avatar answered Sep 28 '22 03:09

auselen


Only one watchdog could be present per system. That could be either a software watchdog or a hardware watchdog. Generally when a watchdog(software/hardware) is inserted, the kernel creates a device node as /dev/watchdog. You can check if the file is present or not. If yes, watchdog is active on your machine, else not.

Now, the /usr/bin/watchdog that your were referring to is a watchdog daemon. It runs in the background and continuously reports the system status to the watchdog(either implemented as hardware/software).

For more info on the daemon, please refer to the man page of watchdog man watchdog.

To check if it is a hardware/software watchdog, just do :

$ lmsmod | grep softdog

If you get an output, your system is running a software watchdog, else a hardware watchdog is implanted into the system. This check is to be done, provided, that you have a node named /dev/watchdog present.

Hope this helps.

like image 39
raghav3276 Avatar answered Sep 28 '22 03:09

raghav3276