};
int long_option_id = -1;
optarg = NULL;
- option = getopt_long(argc, argv, "cdt:gsf:r:n:v:b:h", long_options, &long_option_id);
+ option = getopt_long(argc, argv, "cdt:gsf:r:n:v:b:u:h", long_options, &long_option_id);
if (option < 0)
break;
goto missing_optarg;
buffer_names[buffer_cnt++] = strdup(optarg);
break;
+ case 'u':
+ if (!optarg)
+ goto missing_optarg;
+ if (!isdigit(optarg[0]))
+ goto numeric_optarg;
+ sort_buffer_size = atoi(optarg);
+ break;
case 'f':
if (!optarg)
goto missing_optarg;
sort_timeout = DEFAULT_SORT_TIMEOUT;
}
- conf_value = log_config_get(&conf, "util_sorting_buffer_size");
- if (conf_value)
- sort_buffer_size = atoi(conf_value);
- if (sort_buffer_size <= 0) {
- printf("Warning: util_sorting_buffer_size should be positive! Defaulting to %d\n",
- DEFAULT_SORT_BUFFER_SIZE);
- sort_buffer_size = DEFAULT_SORT_BUFFER_SIZE;
+ if (sort_buffer_size <= 1) {
+ printf("Warning: util_sorting_buffer_size should be more than 1! Get size from conf file.\n");
+ conf_value = log_config_get(&conf, "util_sorting_buffer_size");
+ if (conf_value)
+ sort_buffer_size = atoi(conf_value);
+ if (sort_buffer_size <= 1) {
+ printf("Warning: value of conf file is less than 2! Set to default value.\n");
+ sort_buffer_size = DEFAULT_SORT_BUFFER_SIZE;
+ }
}
logs.data = (struct logger_entry**)calloc(sort_buffer_size, sizeof(struct logger_entry*));
if (!(logs.data)) {
" -g get the size of the log's ring buffer and exit\n"
" -b <buffer> request alternate ring buffer\n"
" ('main' (default), 'radio', 'system', 'apps', 'kmsg')\n"
+ " -u <size> Sets the size of sort buffer (size > 1)\n"
+ " More smaller, more faster but having less sorting quality\n"
" -h or --help show this help\n"
" --dumpfile <file> only for pipe backend. Parses a dlog_logger daemon generated file\n"
"filterspecs are a series of\n<tag>[:priority]\n"