summaryrefslogtreecommitdiff
path: root/src/stats.c
AgeCommit message (Collapse)AuthorFilesLines
2011-10-25core: Add O_CLOEXEC to open()Daniel Wagner1-1/+1
Make sure all file descriptor are closed.
2011-09-12stats: Move stat files to respective service identifier directoryAlok Barsode1-4/+25
2011-06-16element: Remove element.cDaniel Wagner1-0/+1
2011-03-04stats: Fix compiler warning on 64-bit machinesMarcel Holtmann1-1/+1
2011-03-04stats: Add an informational message for mmap failuresGrant Erickson1-3/+9
Added an informational message when mmap fails with EINVAL in stats_file_remap.
2011-03-04stats: Avoid double-frees on a failed mappingGrant Erickson1-2/+16
Added debugging statements and ensure, following calls to g_free, that the statistics file name field is set to NULL to ensure that a failed file mapping and a subsequent call to stats_free doesn't fault when trying to double-free it.
2011-02-03stats: Add comment about MAP_SHAREDDaniel Wagner1-0/+6
Clarify why MAP_SHARED is used instead of the obvious MAP_PRIVATE.
2011-01-31stats: Fix double free errorGrant Erickson1-3/+11
The error appears when stats_file_remap() fails.
2010-12-10stats: Sum stats ring buffer up info history fileDaniel Wagner1-44/+358
When the ring buffer (SERVICE_NAME.data file) is full then it is summarized into a history (SERVICE_NAME.history) file. The history file has the same format as the data file.
2010-10-13Merge stats_create into __connman_stats_service_registerDaniel Wagner1-18/+4
This avoid doing an hash table lookup from __connman_stats_service_register() right after inserting the stats_file pointer into it.
2010-10-13Merge home and roaming stats fileDaniel Wagner1-84/+107
Instead creating for each service two stats file (home and roaming), just create one. Each entry in the file is marked with a flag (home or roaming). The file header contains two additional index which points to the current home or roaming entry. Now we have a nice history in the ring buffer. Additionally this reduces the number of open files by half.
2010-10-11Open stats file late and close them earlyDaniel Wagner1-0/+2
Instead of opening stats file when a service is created, defer it to the point where either __connman_ipconfig_enable or __connman_ipconfig_disable is called.
2010-10-11Initialize struct stat in error case correctlyDaniel Wagner1-0/+1
In the case stat failes to gather information about the log file, it has to initialize struct stat. Otherwise, we will set a random file size.
2010-09-23Fix "invalid file header"Daniel Wagner1-9/+21
Use stat before open the file to find out if the file already exists. Only if file exists and the header is invalid trigger connman_error
2010-09-23Put .data files into a separate directoryDaniel Wagner1-2/+2
2010-09-22Store stats information into separate filesDaniel Wagner1-0/+431
Currently the statistic information is stored into the profile file. This results in rewriting the whole file if connann_stats_save is called. This results in too many disk I/Os for low power devices. Furthermore, only the current value is stored. There is no way to find out how many bytes have been transfered in the last month. First, each service statistic is stored into a separate files under /var/lib/connman having a *.data extension. This file contains fixed sized records of stats counters and will be mmap into memory. It is used like a ring buffer. If the buffer is full or after a certain period (e.g. a month), the raw data will be summerized into the *.info file. Currently the summary is not implented yet. This will be implemented in the next round of patches.