This commit is contained in:
Devaev Maxim 2018-09-17 04:45:15 +03:00
parent 52ee54492d
commit 2c68104349
3 changed files with 14 additions and 6 deletions

View File

@ -257,7 +257,7 @@ static void *_capture_worker_thread(void *v_ctx_ptr) {
*ctx->last_comp_time = last_comp_time;
A_PTHREAD_M_UNLOCK(ctx->last_comp_time_mutex);
LOG_INFO("Compressed JPEG size=%ld; time=%LG (worker %d)", compressed, last_comp_time, ctx->index); // FIXME
LOG_PERF("Compressed JPEG size=%ld; time=%LG (worker %d)", compressed, last_comp_time, ctx->index); // FIXME
}
}

View File

@ -33,6 +33,7 @@ static const struct option _long_opts[] = {
{"v4l2-timeout", required_argument, NULL, 1002},
{"v4l2-error-timeout", required_argument, NULL, 1003},
{"debug", no_argument, NULL, 5000},
{"perf", no_argument, NULL, 5001},
{NULL, 0, NULL, 0},
};
@ -62,7 +63,8 @@ static void _parse_options(int argc, char *argv[], struct device_t *dev) {
int index;
int ch;
debug = false;
log_debug = false;
log_perf = false;
while ((ch = getopt_long(argc, argv, _short_opts, _long_opts, &index)) >= 0) {
switch (ch) {
case 0: break;
@ -81,7 +83,8 @@ static void _parse_options(int argc, char *argv[], struct device_t *dev) {
case 1001: OPT_UNSIGNED(dev->height, "--height", 180);
case 1002: OPT_UNSIGNED(dev->timeout, "--timeout", 1);
case 1003: OPT_UNSIGNED(dev->error_timeout, "--error-timeout", 1);
case 5000: OPT_TRUE(debug);
case 5000: OPT_TRUE(log_debug);
case 5001: OPT_TRUE(log_perf);
case 'h': _help(EXIT_SUCCESS); break;
default: _help(EXIT_FAILURE); break;
}

View File

@ -15,7 +15,8 @@
#include <sys/syscall.h>
bool debug;
bool log_debug;
bool log_perf;
#define SEP_INFO(_x_ch) \
@ -33,11 +34,15 @@ bool debug;
printf("-- INFO " INNER_LOG_PL " -- " _x_msg "\n", INNER_LOG_PARAMS, ##__VA_ARGS__); }
#define LOG_DEBUG(_x_msg, ...) \
{ if (debug) { INNER_LOG_MK_PARAMS; \
{ if (log_debug) { INNER_LOG_MK_PARAMS; \
printf("-- DEBUG " INNER_LOG_PL " -- " _x_msg "\n", INNER_LOG_PARAMS, ##__VA_ARGS__); } }
#define LOG_PERF(_x_msg, ...) \
{ if (log_debug || log_perf) { INNER_LOG_MK_PARAMS; \
printf("-- PERF " INNER_LOG_PL " -- " _x_msg "\n", INNER_LOG_PARAMS, ##__VA_ARGS__); } }
#define SEP_DEBUG(_x_ch) \
{ if (debug) { SEP_INFO(_x_ch); } }
{ if (log_debug) { SEP_INFO(_x_ch); } }
#define LOG_ERROR(_x_msg, ...) \
{ INNER_LOG_MK_PARAMS; \