From: Daniel Lord <d_lord@gmx.de>
To: linux-media@vger.kernel.org
Subject: Patch to add a timestamping and version option to femon
Date: Fri, 13 Feb 2015 14:42:38 +0100 [thread overview]
Message-ID: <20150213134238.GA17802@gmx.de> (raw)
[-- 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);
reply other threads:[~2015-02-13 13:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150213134238.GA17802@gmx.de \
--to=d_lord@gmx.de \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.