All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch to add a timestamping and version option to femon
@ 2015-02-13 13:42 Daniel Lord
  0 siblings, 0 replies; only message in thread
From: Daniel Lord @ 2015-02-13 13:42 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

Hi,

as I have been in need for a monitoring tool, to check the (in)stability of my
SAT-DVB setup I came across femon of dvb-apps. As it doesn't has a timestamp
option I haven't been able to correlate the outage of video with a signal
reported by femon easily.

Therefore please find attached a patch which adds a timestamping option (-t)
to femon.

It also adds a version option (-v) as you stated somewhere on your homepage
this would be needed. Be carefull with the compiletime/date line. It will
break the debian reproducable build system.

Kind regards

    Daniel

[-- Attachment #2: femon.diff --]
[-- Type: text/x-diff, Size: 1748 bytes --]

34d33
< #include <time.h>
42,43d40
< #define TLEN 150
< #define VERSION "0.2"
54,56c51
<     "     -c number : samples to take (default 0 = infinite)\n"
<     "     -v        : display version information\n"
<     "     -t        : add timestamp for monitoring\n\n";
---
>     "     -c number : samples to take (default 0 = infinite)\n\n";
61d55
< char timebuf[TLEN];
69,74d62
< static void version(void)
< {
< 	printf("This is femon version %s\n", VERSION);
< 	printf("compiled at %s %s\n", __DATE__, __TIME__); /* remove for reproduceable builds */
< 	exit(1);
< }
77c65
< int check_frontend (struct dvbfe_handle *fe, int human_readable, unsigned int count, int timestamp)
---
> int check_frontend (struct dvbfe_handle *fe, int human_readable, unsigned int count)
82d69
< 	time_t curtime = time(NULL);
109,114c96
< if (timestamp) {
< 	curtime = time(NULL);
< 	strncpy(timebuf,ctime(&curtime),TLEN);
< 	timebuf[strlen(timebuf) - 1] = 0x00;
< 	printf("%s | ",timebuf);
< }
---
> 
166c148
< int do_mon(unsigned int adapter, unsigned int frontend, int human_readable, unsigned int count, int timestamp)
---
> int do_mon(unsigned int adapter, unsigned int frontend, int human_readable, unsigned int count)
196c178
< 	result = check_frontend (fe, human_readable, count, timestamp);
---
> 	result = check_frontend (fe, human_readable, count);
208d189
< 	int timestamp = 0;
210c191
< 	   while ((opt = getopt(argc, argv, "vrAHta:f:c:")) != -1) {
---
>        while ((opt = getopt(argc, argv, "rAHa:f:c:")) != -1) {
216,218d196
< 		case 'v':
< 			version();
< 			break;
240,242d217
< 		case 't':
< 			timestamp=1;
< 			break;
246c221
< 	do_mon(adapter, frontend, human_readable, count, timestamp);
---
> 	do_mon(adapter, frontend, human_readable, count);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-13 13:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13 13:42 Patch to add a timestamping and version option to femon Daniel Lord

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.