aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2015-12-21stat: Explicitly support stat_items without unitzecke/ancient/debian6.0Jacob Erlbeck2-2/+15
Add OSMO_STAT_ITEM_NO_UNIT for stat items without an unit. The statsd reporter uses gauges ("g") to report them. Sponsored-by: On-Waves ehf [hfreyther: Manually apply change to osmo_stats_reporter_statsd_send_item]
2015-12-17ns: Force a defined state when sending NS RESETJacob Erlbeck1-0/+6
Currently the state is assumed to remain the same while the reset procedure is active. While this works correctly in general, a single unexpected BLOCK_ACK or UNBLOCK_ACK can change the state but will not stop the reset procedure. The leads to repeated RESET messages, where the corresponding RESET_ACK is ignored. This is a stable state which can only be left by manual intervention or by reception of a RESET message from the peer. This commit changes the RESET timeout handler to set the state to BLOCKED/RESET when sending the new NS RESET message. Note that this should ensure a clean restart even if the state has been screwed up. It does not fix the handling of BLOCK_ACK or UNBLOCK_ACK in abnormal cases. Addresses: gprs_ns.c:349 NSEI=8895 Tx NS RESET (NSVCI=8895, cause=O&M intervention) gprs_ns.c:878 NSVCI=8895 Rx NS RESET ACK (NSEI=8895, NSVCI=8895) gprs_ns.c:887 NS RESET ACK Discarding unexpected message for NS-VCI 8895 from SGSN NSEI=8895 Ticket: OW#1551 Sponsored-by: On-Waves ehf
2015-12-17ns/stats: Add missing osmo_stat_item_group_free to gprs_nsvc_deleteJacob Erlbeck1-0/+1
The stat item group is not removed by gprs_nsvc_delete which will corrupt the group list. Addresses: valgrind tests/gbproxy/gbproxy_test [...] ==4541== Invalid write of size 4 ==4541== at 0x4071ACA: __llist_add (linuxlist.h:65) ==4541== by 0x4071ACA: llist_add (linuxlist.h:81) ==4541== by 0x4071ACA: osmo_stat_item_group_alloc (stat_item.c:112) ==4541== by 0x407EDFD: gprs_nsvc_create (gprs_ns.c:244) ==4541== by 0x408109D: gprs_ns_instantiate (gprs_ns.c:1388) ==4541== by 0x804CFD3: test_gbproxy_ident_changes (gbproxy_test.c:1501) ==4541== by 0x805FBD3: main (gbproxy_test.c:5803) Sponsored-by: On-Waves ehf
2015-11-09stats: Fix not reported stat item valuesJacob Erlbeck1-1/+3
Currently the global stat item index is being advanced in osmo_stat_item_group_handler, so that the second and further groups in the list will skip new item values. This commit moves the call to osmo_stat_item_discard_all into osmo_stats_report to a place where all groups have been processed already. Sponsored-by: On-Waves ehf
2015-11-09stats: Fix handling of multiple resportersJacob Erlbeck1-2/+2
Currently the reporter loop is aborted, if the event would be ignored due to an insufficient max_level. Thus the reporters that happen to be stored afterwards would be skipped even if their level were sufficient. This commit replaces the conditional 'return' statement by a considtional 'continue' statement to ensure the processing of the list tail. Sponsored-by: On-Waves ehf
2015-11-09stats: Send all values on reporter updateJacob Erlbeck1-8/+25
Currently only counter changes and new item values are being reported. This makes it cumbersome to configure reporting clients, since there is nothing like a list of all parameters. This commit changes this behaviour such that all currently existing counters and items that would be reported eventually, are passed to the reporter when it has been reconfigured or enabled. If a counter has not been incremented, 0 is sent. If a stat item value has not been added, the last item value (or the default value if there is none) is resent again. Note that this will not catch transient counters/items that will be created later on, e.g. triggered by new peers or subscribers. To just force this kind of dump on a running reporter, it is sufficient to invoke the 'enable' command in its configuration node. Sponsored-by: On-Waves ehf
2015-11-09stats: Fix name prefix handlingJacob Erlbeck1-11/+23
Currently the having an unset prefix leads to an abort() in the statsd reporter due to an fprintf format string error. In addition the prefix cannot be reset to its initial state (NULL) by using 'no prefix', which just sets the prefix to the empty string, causing a single leading dot to appear in front of the name. This commit changes the implemenation to consistly use NULL for the unset name prefix ('no prefix') and to handle this case correctly in the statsd reporter. Sponsored-by: On-Waves ehf
2015-11-07stats: Document the level in show stats level optionsHolger Hans Peter Freyther1-0/+1
Potentially Fixes: <command id='show stats level (global|peer|subscriber)'> <param name='subscriber' doc='(null)' />
2015-11-04gprs-ns/stats: When the NSVCI is updated, update the stats counterHolger Hans Peter Freyther1-0/+2
The NS object is created with an unknown identity and only after the reset procedure has progressed (completed?) we know the real ID for this peer. Before nobody has looked at the idx values (this could have been seen with the CTRL interface) but with statsd the wrong NSVCI becomes obvious. Add routines to update the idx and I don't know if the change of idx is causing any issues but we will find that out soon.
2015-08-22stats/vty: Add selective show stats commandJacob Erlbeck2-2/+31
Currently there is only the 'show stats' command which shows all counter and stat_item values. This can lead to many lines of output if there are per-subscriber rate counters. The new command added by this commit allows it to only show groups of a certain level (class_id), similar to the 'level' configuration command for stats reporter. The new command is show stats level (global|peer|subscriber) Sponsored-by: On-Waves ehf
2015-08-22ns/stats: Fix class_id of "NSVC Peer Statistics" rate_ctr groupJacob Erlbeck1-0/+1
Currently the class_id is not set which effectively puts these groups into the 'subscriber' class. This commit adds the missing initialisation value. Sponsored-by: On-Waves ehf
2015-11-03misc: Prepare the release of libosmocore 0.9.00.9.0Holger Hans Peter Freyther1-1/+1
Bump the ABI version of libosmovty and we need to do this recursively to force rebuilds of our software.
2015-08-21stats: Fix build on FreeBSDHolger Hans Peter Freyther1-1/+2
include stdint.h for int64_t and use netinet/in.h and not netinet/ip.h for getting sockaddr_in and such.
2015-08-21timer: Fix compiler warning about timevalHolger Hans Peter Freyther1-3/+4
timer.c:27:23: warning: tentative definition of variable with internal linkage has incomplete non-array type 'struct timeval' [-Wtentative-definition-incomplete-type] static struct timeval nearest; ^ timer.c:27:15: note: forward declaration of 'struct timeval' static struct timeval nearest;
2015-11-02fix some typosNeels Hofmeyr1-2/+2
Sponsored-by: On-Waves ehi
2015-11-02stats: Fix handling of the no mtu commandHolger Hans Peter Freyther1-1/+1
For the atoi we need to pass the val as a string. This means we need to write "0" which then gets parsed to 0. [src/vty/stats_vty.c:90]: (error) Possible null pointer dereference: val
2015-11-02stats: Do not assign the wrong addresssHolger Hans Peter Freyther1-1/+1
we need to put the default value into inaddr and not put a 32bit value into the addr pointer. Spotted by cppcheck: [src/stats.c:231]: (error) Uninitialized variable: inaddr
2015-11-02stats: Remove warnings about never read variablesHolger Hans Peter Freyther1-8/+5
Nothing is being done with these return values. Remove them for now and update the TODO entry that is present at two of the three places. stats.c: In function ‘rate_ctr_handler’: stats.c:570:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] int rc; ^ stats.c: In function ‘osmo_stat_item_handler’: stats.c:617:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] int rc; ^ stats.c: In function ‘handle_counter’: stats.c:651:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable] int rc;
2015-11-02log: Add new DLSTATS log levelJacob Erlbeck2-4/+6
This log level is used by the stats subsystem log reporter to report statistics to level INFO. Note that the default level of DLSTATS is NOTICE. Sponsored-by: On-Waves ehf
2015-11-02stats: Limit reporting by class idJacob Erlbeck4-0/+70
This commit adds class_id fields to the rate_ctr and stat_item group descriptions. The stats reporter code is extended to only process groups whose class_id does not exceed a per reporter max_class level. If the class_id is not set, the code assumes 'global' for groups with idx == 0 and 'subscriber' otherwise. The following vty command is added to config-stats: level (global|peer|subscriber) Set the maximum group level Sponsored-by: On-Waves ehf
2015-11-02stats: Report group indices as unsigned intJacob Erlbeck1-8/+9
Currently the unsigned group index value is silently being cast to (signed) int in the log and statsd reporter code. If the resulting value is negative (which can happen for instance with MMCTX counters), the index is assumed to be unset. This commit changes the affected types to unsigned. The index value 0 is then the only value indicating an unset group. Sponsored-by: On-Waves ehf
2015-11-02stats: Add osmo_ name prefix to identifiersJacob Erlbeck5-190/+190
Since the the stat_item and stats functions and data types are meant to be exported, they get an osmo_ prefix. Sponsored-by: On-Waves ehf [hfreyther: Prepended the enum values too. This was requested by Jacob]
2015-10-29stats: Add log reporterJacob Erlbeck2-0/+112
This reporter passes the measurement values to the logging subsystem as DSTATS (which is currently DLGLOBAL) level INFO messages. Sponsored-by: On-Waves ehf
2015-10-29stats: Use function pointers in reporter objectsJacob Erlbeck1-25/+26
Currently case statements are used to select the right reporter functions. This makes it difficult to add new reporter types, especially if they are not going to reside in the same file. This commit introduces per reporter function pointer for open, close, send_count, and send_item. They are checked for non-NULL before being called or skipped. Sponsored-by: On-Waves ehf
2015-10-29stats: Make net config optionalJacob Erlbeck2-12/+29
To support reporters without network configuration, this commit introduces the have_net_config flag to provide corresponding error messages. Sponsored-by: On-Waves ehf
2015-10-29stats: Add missing mtu command to 'write' outputJacob Erlbeck1-0/+3
Currently the config_write_stats_reporter function does not output the mtu value, which is fixed by this commit. Sponsored-by: On-Waves ehf
2015-10-29stats: Support statsd Multi-Metric PacketsJacob Erlbeck2-11/+116
If the MTU is given, combine several messages into a single UDP packet until the limit is reached. Flush all reporters after the values have been scanned. New vty commands (node config-stats): mtu <100-65535> Enable multi-metric packets and set the maximum packet size (in byte) no mtu Disable multi-metric packets Note that single messages that are longer than the given MTU (minus 28 octets protocol overhead) will be dropped. Sponsored-by: On-Waves ehf
2015-10-29stats: Add support for osmo_countersJacob Erlbeck1-0/+32
This commit changes the reporting code to also show all modified osmo_counter values. Since there is no grouping of these values, the name string just consists of the optional prefix and the counter name. Sponsored-by: On-Waves ehf
2015-10-29core: Add difference function to osmo_counterJacob Erlbeck1-0/+8
The osmo_counter_difference returns the counter value difference since the last call of this function with the given counter object. Sponsored-by: On-Waves ehf
2015-10-29stats: Report stat item valuesJacob Erlbeck1-0/+49
Currently only rate counter are being supported. This commit adds support for stat items. All groups are polled for changed values. Sponsored-by: On-Waves ehf
2015-10-29stats: Implement timer based reportingJacob Erlbeck2-16/+64
This calls stats_flush in regular intervals which polls the statistical values and calls the active reporters when values have changed. Sponsored-by: On-Waves ehf
2015-10-29stats/vty: Add stats configurationJacob Erlbeck1-1/+260
This commit provides stats configuration similar to the log configuration. The following vty commands are added to the config node: stats reporter statsd Create/Modify a statsd reporter no stats reporter statsd Remove a statsd reporter To actually configure a reporter, the config-stats node is entered when the "stats reporter" command has succeeded. The following new vty commands are available there: local-ip ADDR Set the IP address to which we bind locally no local-ip Do not bind to a certain IP address remote-ip ADDR Set the remote IP address to which we connect remote-port <1-65535> Set the remote port to which we connect prefix PREFIX Set the item/counter name prefix no prefix Do not use a prefix enable Enable the reporter disable Disable the reporter Sponsored-by: On-Waves ehf
2015-10-29stats: Add the reporting frameworkJacob Erlbeck2-1/+388
This commit provides the stats reporting framework that can manage several types of measurement reporters. Initially support for rate_ctr and the statsd protocol is included. Sponsored-by: On-Waves ehf
2015-10-29stats/vty: Add stats_vty.cJacob Erlbeck2-1/+53
This file will contain the VTY code related to statistics. This commit adds a minimal file with just as single VTY command: - show stats This command shows all statistical values To enable this and future commands, the main program needs to call stats_vty_add_cmds(). Sponsored-by: On-Waves ehf
2015-10-28stat/vty: Add vty_out_statistics_full to show all statisticsJacob Erlbeck1-0/+58
This functions shows the state of all osmo_counters, stat_item groups, and counter groups. Sponsored-by: On-Waves ehf
2015-10-28stat/vty: Use the iterator algorithms to show ctrg and statgJacob Erlbeck1-20/+43
Currently the groups for stat_items and counter are iterated manually. This commit makes use of the new iterator functions to access the single elements via handlers. Sponsored-by: On-Waves ehf
2015-10-28stats: Add stat_item_for_each functionsJacob Erlbeck1-0/+30
This commit adds the following functions: stat_item_for_each_group Call a handler for each group stat_item_for_each_item Call a handler for each item of a group Sponsored-by: On-Waves ehf
2015-10-28core: Extend rate_ctr by helper functionsJacob Erlbeck1-0/+41
For global value reporting, some additional helper functions are needed. The statsd protocol expects differential counter values, which are currently not provided by rate_ctr (except for s/m/h/d intervals). This commit adds several helper functions to rate_ctr: - rate_ctr_difference returns the counter delta since the last call to this function for a given counter - rate_ctr_for_each_counter iterates through each counter of a group - rate_ctr_for_each_group iterates through all globally registered counter groups Note that the rate_ctr_difference function can only be used by a single backend, since it modifies the 'previous' field in the rate_ctr obj. Sponsored-by: On-Waves ehf
2015-10-28stats: Use a global index for stat item valuesJacob Erlbeck1-24/+47
Currently each stat item has a separate index value which basically counts each single value added to the item and which can be used by a reporter to get all new values that have not been reported yet. The drawback is, that such an index must be stored for each stat item. This commit introduces a global index which is incremented for each new stat item value. This index is then stored together with the item value. So a single stored index per reporter is sufficient to make sure that only new values are reported. Sponsored-by: On-Waves ehf
2015-10-28ns: Add statistics for some eventsJacob Erlbeck2-1/+39
The following counters are added to the ns.nsvc counter group: lost.alive The number of missing ALIVE ACK messages lost.reset The number of missing RESET ACK messages The following items are added to the ns.nsvc stat item group: alive.delay The time in ms between sending ALIVE and receiving the next ALIVE ACK Sponsored-by: On-Waves ehf
2015-10-28stats: Add vty_out_stat_item_groupJacob Erlbeck1-0/+22
This functions dumps a whole stat item group to the VTY. Sponsored-by: On-Waves ehf
2015-10-28stats: Add stat_item for value monitoringJacob Erlbeck2-1/+216
This commit adds instrumentation function to gather measurement and statistical values similar to counter groups. Multiple values can be stored per item, which can be retrieved in FIFO order. Getting values from the item does not modify its state to allow for multiple independant backends (e.g. VTY and statd). When a new value is set, the oldest value gets silently overwritten. Lost values are skipped when getting values from the item. Sponsored-by: On-Waves ehf
2015-09-23utils: add 'returns' doc to osmo_hexparse().Neels Hofmeyr1-0/+1
2015-09-16build: have a disable-static build succeedJan Engelhardt1-2/+6
When using configure --disable-static, no libosmogsm.a will be created, and the tests fail to link because symbols like _a5_3 and _a5_4 are not exported through the only remaining libosmogsm.so. A method to overcome this is an intermediate private non-distributed library, examples of which are present in e.g. libabc, kmod and systemd. With this, disable-static can now be the default and practical compile time be halved.
2015-08-23Prepare new upstream release0.8.3Holger Hans Peter Freyther1-1/+1
2015-08-18Introduce gsm48_mi_type_name() functionHarald Welte2-0/+15
2015-08-18Add G-RNTI derived TLLI types defined in 23.003Harald Welte1-1/+5
2015-08-05vty: Change API to have node installation be done by intHolger Hans Peter Freyther1-4/+4
We are mixing enums and hope that no short-enums are used. This is leading to a lot compiler warnings generated by clang. Change the API to work with integers. Porting: The go_parent_cb implementations in the applications need to be fixed. The API change leads to a compile time warning. Fixes: abis_om2000_vty.c:46:2: warning: implicit conversion from enumeration type 'enum bsc_vty_node' to different enumeration type 'enum node_type' [-Wenum-conversion] OM2K_NODE, ^~~~~~~~~
2015-08-01release: Prepare the 0.8.2 release0.8.2Holger Hans Peter Freyther1-1/+1
I have kind of used 0.8.1 by accident already so let us move to 0.8.2 now.
2015-06-19bssgp: Fix IMSI buffer size (Coverity)Jacob Erlbeck1-2/+4
Currently the size of the IMSI pointer is used instead of the size of the talloc'ed buffer. This commit changes the call to gsm48_mi_to_string to use the same value that has been used with talloc_zero_size(). The length is changed to 17 since that value is used for GSM_IMSI_LENGTH in openbsc. Fixes: Coverity CID 1040663 Sponsored-by: On-Waves ehf