This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
daniel gerrit-no-reply at lists.osmocom.orgdaniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18720 ) Change subject: Count assignment rates per BTS as well ...................................................................... Count assignment rates per BTS as well This adds the assignment counters for the BTS as well and changes the assignment_count() macro to increase both the counters for the BSC as well as the BTS. Related: SYS#4877 Change-Id: I0009e51d4caf68e762138d98e2e23d49acc3cc1a --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/gsm_04_08_rr.c 3 files changed, 30 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/20/18720/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index c4e3a46..9fed4ea 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1427,6 +1427,13 @@ BTS_CTR_TS_BORKEN_EV_PDCH_ACT_ACK_NACK, BTS_CTR_TS_BORKEN_EV_PDCH_DEACT_ACK_NACK, BTS_CTR_TS_BORKEN_EV_TEARDOWN, + BTS_CTR_ASSIGNMENT_ATTEMPTED, + BTS_CTR_ASSIGNMENT_COMPLETED, + BTS_CTR_ASSIGNMENT_STOPPED, + BTS_CTR_ASSIGNMENT_NO_CHANNEL, + BTS_CTR_ASSIGNMENT_TIMEOUT, + BTS_CTR_ASSIGNMENT_FAILED, + BTS_CTR_ASSIGNMENT_ERROR, }; static const struct rate_ctr_desc bts_ctr_description[] = { @@ -1477,6 +1484,13 @@ [BTS_CTR_TS_BORKEN_EV_PDCH_ACT_ACK_NACK] = {"ts_borken:event:pdch_act_ack_nack", "PDCH_ACT_ACK/NACK received in the TS BORKEN state"}, [BTS_CTR_TS_BORKEN_EV_PDCH_DEACT_ACK_NACK] = {"ts_borken:event:pdch_deact_ack_nack", "PDCH_DEACT_ACK/NACK received in the TS BORKEN state"}, [BTS_CTR_TS_BORKEN_EV_TEARDOWN] = {"ts_borken:event:teardown", "TS in a BORKEN state is shutting down (BTS disconnected?)"}, + [BTS_CTR_ASSIGNMENT_ATTEMPTED] = {"assignment:attempted", "Assignment attempts."}, + [BTS_CTR_ASSIGNMENT_COMPLETED] = {"assignment:completed", "Assignment completed."}, + [BTS_CTR_ASSIGNMENT_STOPPED] = {"assignment:stopped", "Connection ended during Assignment."}, + [BTS_CTR_ASSIGNMENT_NO_CHANNEL] = {"assignment:no_channel", "Failure to allocate lchan for Assignment."}, + [BTS_CTR_ASSIGNMENT_TIMEOUT] = {"assignment:timeout", "Assignment timed out."}, + [BTS_CTR_ASSIGNMENT_FAILED] = {"assignment:failed", "Received Assignment Failure message."}, + [BTS_CTR_ASSIGNMENT_ERROR] = {"assignment:error", "Assignment failed for other reason."}, }; static const struct rate_ctr_group_desc bts_ctrg_desc = { diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index 674dcbc..94dd359 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -69,16 +69,18 @@ _conn->assignment.failure_cause = cause; \ LOG_ASSIGNMENT(_conn, LOGL_ERROR, "Assignment failed in state %s, cause %s: " fmt "\n", \ osmo_fsm_inst_state_name(fi), gsm0808_cause_name(cause), ## args); \ - assignment_count_result(BSC_CTR_ASSIGNMENT_ERROR); \ + assignment_count_result(CTR_ASSIGNMENT_ERROR); \ on_assignment_failure(_conn); \ } while(0) /* Assume presence of local var 'conn' as struct gsm_subscriber_connection */ #define assignment_count(counter) do { \ + struct gsm_bts *bts = conn_get_bts(conn); \ LOG_ASSIGNMENT(conn, LOGL_DEBUG, "incrementing rate counter: %s %s\n", \ - bsc_ctr_description[counter].name, \ - bsc_ctr_description[counter].description); \ - rate_ctr_inc(&conn->network->bsc_ctrs->ctr[counter]); \ + bsc_ctr_description[BSC_##counter].name, \ + bsc_ctr_description[BSC_##counter].description); \ + rate_ctr_inc(&conn->network->bsc_ctrs->ctr[BSC_##counter]); \ + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_##counter]); \ } while(0) #define assignment_count_result(counter) do { \ @@ -88,8 +90,8 @@ } else \ LOG_ASSIGNMENT(conn, LOGL_DEBUG, \ "result rate counter already recorded, NOT counting as: %s %s\n", \ - bsc_ctr_description[counter].name, \ - bsc_ctr_description[counter].description); \ + bsc_ctr_description[BSC_##counter].name, \ + bsc_ctr_description[BSC_##counter].description); \ } while(0) void assignment_reset(struct gsm_subscriber_connection *conn) @@ -250,7 +252,7 @@ LOG_ASSIGNMENT(conn, LOGL_DEBUG, "Assignment successful\n"); osmo_fsm_inst_term(conn->assignment.fi, OSMO_FSM_TERM_REGULAR, 0); - assignment_count_result(BSC_CTR_ASSIGNMENT_COMPLETED); + assignment_count_result(CTR_ASSIGNMENT_COMPLETED); } static void assignment_fsm_update_id(struct gsm_subscriber_connection *conn) @@ -426,7 +428,7 @@ OSMO_ASSERT(!conn->assignment.fi); OSMO_ASSERT(!conn->assignment.new_lchan); - assignment_count(BSC_CTR_ASSIGNMENT_ATTEMPTED); + assignment_count(CTR_ASSIGNMENT_ATTEMPTED); fi = osmo_fsm_inst_alloc_child(&assignment_fsm, conn->fi, GSCON_EV_ASSIGNMENT_END); OSMO_ASSERT(fi); @@ -456,7 +458,7 @@ /* If something went wrong during send_assignment_complete(), the fi will be gone from * error handling in there. */ if (conn->assignment.fi) { - assignment_count_result(BSC_CTR_ASSIGNMENT_COMPLETED); + assignment_count_result(CTR_ASSIGNMENT_COMPLETED); osmo_fsm_inst_term(conn->assignment.fi, OSMO_FSM_TERM_REGULAR, 0); } return; @@ -474,7 +476,7 @@ /* Check whether the lchan allocation was successful or not and tear * down the assignment in case of failure. */ if (!conn->assignment.new_lchan) { - assignment_count_result(BSC_CTR_ASSIGNMENT_NO_CHANNEL); + assignment_count_result(CTR_ASSIGNMENT_NO_CHANNEL); assignment_fail(GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE, "BSSMAP Assignment Command:" " No lchan available for: pref=%s:%s / alt1=%s:%s / alt2=%s:%s\n", @@ -565,7 +567,7 @@ return; case ASSIGNMENT_EV_RR_ASSIGNMENT_FAIL: - assignment_count_result(BSC_CTR_ASSIGNMENT_FAILED); + assignment_count_result(CTR_ASSIGNMENT_FAILED); assignment_fail(get_cause(data), "Rx RR Assignment Failure"); return; @@ -733,7 +735,7 @@ switch (event) { case ASSIGNMENT_EV_CONN_RELEASING: - assignment_count_result(BSC_CTR_ASSIGNMENT_STOPPED); + assignment_count_result(CTR_ASSIGNMENT_STOPPED); osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); return; @@ -753,7 +755,7 @@ int assignment_fsm_timer_cb(struct osmo_fsm_inst *fi) { struct gsm_subscriber_connection *conn = assignment_fi_conn(fi); - assignment_count_result(BSC_CTR_ASSIGNMENT_TIMEOUT); + assignment_count_result(CTR_ASSIGNMENT_TIMEOUT); assignment_fail(GSM0808_CAUSE_EQUIPMENT_FAILURE, "Timeout"); return 0; } diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index 4e5a307..d429b05 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -554,6 +554,7 @@ /* Chapter 9.1.2: Assignment Command */ int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, uint8_t power_command) { + struct gsm_bts *bts = dest_lchan->ts->trx->bts; struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 ASS CMD"); struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); struct gsm48_ass_cmd *ass = -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18720 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I0009e51d4caf68e762138d98e2e23d49acc3cc1a Gerrit-Change-Number: 18720 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann at sysmocom.de> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200608/f553fe87/attachment.htm>