From 176ffa54b44f2ef73f23e3252dd439f52fab3265 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 19 Oct 2012 19:35:01 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system finished most of conversion of llviewerassetstats ported some param block fixes from viewer-chui converted viewer asset stats to param block format --- indra/llcommon/llinitparam.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/llcommon/llinitparam.cpp') diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index db72aa19b9..54e98e66f3 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -196,12 +196,7 @@ namespace LLInitParam if (serialize_func) { const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL; - // each param descriptor remembers its serial number - // so we can inspect the same param under different names - // and see that it has the same number - name_stack.push_back(std::make_pair("", true)); serialize_func(*param, parser, name_stack, diff_param); - name_stack.pop_back(); } } -- cgit v1.2.3 From d6634fcd2433e18eea1a9bf31da6d7e531817d77 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 22 Oct 2012 19:54:10 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system sanitized param block code to accept isValid and isProvided at any point added predicates to control serialization --- indra/llcommon/llinitparam.cpp | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'indra/llcommon/llinitparam.cpp') diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index 54e98e66f3..a63e792925 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -164,24 +164,37 @@ namespace LLInitParam bool BaseBlock::validateBlock(bool emit_errors) const { - const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); - for (BlockDescriptor::param_validation_list_t::const_iterator it = block_data.mValidationList.begin(); it != block_data.mValidationList.end(); ++it) + // only validate block when it hasn't already passed validation with current data + if (!mValidated) { - const Param* param = getParamFromHandle(it->first); - if (!it->second(param)) + const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); + for (BlockDescriptor::param_validation_list_t::const_iterator it = block_data.mValidationList.begin(); it != block_data.mValidationList.end(); ++it) { - if (emit_errors) + const Param* param = getParamFromHandle(it->first); + if (!it->second(param)) { - llwarns << "Invalid param \"" << getParamName(block_data, param) << "\"" << llendl; + if (emit_errors) + { + llwarns << "Invalid param \"" << getParamName(block_data, param) << "\"" << llendl; + } + return false; } - return false; } + mValidated = true; } - return true; + return mValidated; } - void BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const LLInitParam::BaseBlock* diff_block) const + void BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const LLInitParam::BaseBlock* diff_block) const { + if (!isProvided()) + { + if ((~predicate_rule_t(PROVIDED) && predicate_rule).isTriviallyFalse()) + { + return; + } + } + // named param is one like LLView::Params::follows // unnamed param is like LLView::Params::rect - implicit const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); @@ -196,7 +209,7 @@ namespace LLInitParam if (serialize_func) { const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL; - serialize_func(*param, parser, name_stack, diff_param); + serialize_func(*param, parser, name_stack, predicate_rule, diff_param); } } @@ -232,7 +245,7 @@ namespace LLInitParam name_stack.push_back(std::make_pair(it->first, !duplicate)); const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL; - serialize_func(*param, parser, name_stack, diff_param); + serialize_func(*param, parser, name_stack, predicate_rule, diff_param); name_stack.pop_back(); } } -- cgit v1.2.3 From 50ad343366f5e18ced40e24e2a1cc2399411c7e5 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 22 Oct 2012 22:46:45 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system added return value to serialize function to track if any values were written --- indra/llcommon/llinitparam.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra/llcommon/llinitparam.cpp') diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index 54e98e66f3..d6326a7c11 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -180,8 +180,9 @@ namespace LLInitParam return true; } - void BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const LLInitParam::BaseBlock* diff_block) const + bool BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const LLInitParam::BaseBlock* diff_block) const { + bool serialized = false; // named param is one like LLView::Params::follows // unnamed param is like LLView::Params::rect - implicit const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); @@ -193,10 +194,10 @@ namespace LLInitParam param_handle_t param_handle = (*it)->mParamHandle; const Param* param = getParamFromHandle(param_handle); ParamDescriptor::serialize_func_t serialize_func = (*it)->mSerializeFunc; - if (serialize_func) + if (serialize_func && param->anyProvided()) { const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL; - serialize_func(*param, parser, name_stack, diff_param); + serialized |= serialize_func(*param, parser, name_stack, diff_param); } } @@ -232,10 +233,13 @@ namespace LLInitParam name_stack.push_back(std::make_pair(it->first, !duplicate)); const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL; - serialize_func(*param, parser, name_stack, diff_param); + serialized |= serialize_func(*param, parser, name_stack, diff_param); name_stack.pop_back(); } } + + // was anything serialized in this block? + return serialized; } bool BaseBlock::inspectBlock(Parser& parser, Parser::name_stack_t name_stack, S32 min_count, S32 max_count) const @@ -354,7 +358,7 @@ namespace LLInitParam } //static - void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptorPtr in_param, const char* char_name) + void BaseBlock::addParam(BlockDescriptor& block_data, ParamDescriptorPtr in_param, const char* char_name) { // create a copy of the param descriptor in mAllParams // so other data structures can store a pointer to it -- cgit v1.2.3 From 638a16eedd12fe03b85703fb821bc05f40aab355 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 23 Oct 2012 22:35:47 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system improved predicate system, added uncertain/unknown predicates --- indra/llcommon/llinitparam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llinitparam.cpp') diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index b4dcf3493c..69f97e87c4 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -185,7 +185,7 @@ namespace LLInitParam return mValidated; } - bool BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const LLInitParam::BaseBlock* diff_block) const + bool BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const LLInitParam::BaseBlock* diff_block) const { bool serialized = false; if (!isProvided()) -- cgit v1.2.3 From 3ffd0be53af0c5338e6fdc77d240e976aeb10451 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 26 Oct 2012 20:03:33 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system fixed llpredicate so that values and rules work uniformly with predicate logic and/or/negate works in parallel with set/clear --- indra/llcommon/llinitparam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llinitparam.cpp') diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index 69f97e87c4..c66659a696 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -190,7 +190,7 @@ namespace LLInitParam bool serialized = false; if (!isProvided()) { - if ((~predicate_rule_t(PROVIDED) && predicate_rule).isTriviallyFalse()) + if (predicate_rule_t(~ll_predicate(PROVIDED) && predicate_rule).isTriviallyFalse()) { return false; } -- cgit v1.2.3 From b71e991c1860bbea0387f9434cc2b4b31a26469a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 29 Oct 2012 18:44:37 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system fixed predicate update logic and reduced to 2 classes --- indra/llcommon/llinitparam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llinitparam.cpp') diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index c66659a696..afeac0a905 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -190,7 +190,7 @@ namespace LLInitParam bool serialized = false; if (!isProvided()) { - if (predicate_rule_t(~ll_predicate(PROVIDED) && predicate_rule).isTriviallyFalse()) + if ((predicate_rule && !ll_predicate(PROVIDED)).isTriviallyFalse()) { return false; } -- cgit v1.2.3 From bb6bda9eef48f5b08b56af46321b79fe7f1d49d7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Nov 2012 19:55:06 -0700 Subject: SH-3499 Ensure asset stats output is correct added support for specifying predicates for xui and llsd serialization --- indra/llcommon/llinitparam.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'indra/llcommon/llinitparam.cpp') diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index afeac0a905..53254c3b56 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -188,12 +188,9 @@ namespace LLInitParam bool BaseBlock::serializeBlock(Parser& parser, Parser::name_stack_t& name_stack, const predicate_rule_t predicate_rule, const LLInitParam::BaseBlock* diff_block) const { bool serialized = false; - if (!isProvided()) + if (!predicate_rule.check(ll_make_predicate(PROVIDED, isProvided()))) { - if ((predicate_rule && !ll_predicate(PROVIDED)).isTriviallyFalse()) - { - return false; - } + return false; } // named param is one like LLView::Params::follows // unnamed param is like LLView::Params::rect - implicit @@ -206,7 +203,7 @@ namespace LLInitParam param_handle_t param_handle = (*it)->mParamHandle; const Param* param = getParamFromHandle(param_handle); ParamDescriptor::serialize_func_t serialize_func = (*it)->mSerializeFunc; - if (serialize_func && param->anyProvided()) + if (serialize_func && predicate_rule.check(ll_make_predicate(PROVIDED, param->anyProvided()))) { const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL; serialized |= serialize_func(*param, parser, name_stack, predicate_rule, diff_param); @@ -220,7 +217,7 @@ namespace LLInitParam param_handle_t param_handle = it->second->mParamHandle; const Param* param = getParamFromHandle(param_handle); ParamDescriptor::serialize_func_t serialize_func = it->second->mSerializeFunc; - if (serialize_func && param->anyProvided()) + if (serialize_func && predicate_rule.check(ll_make_predicate(PROVIDED, param->anyProvided()))) { // Ensure this param has not already been serialized // Prevents from being serialized as its own tag. -- cgit v1.2.3 From f8eaee753174d0cab4e4edcf795f422706d6f302 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 2 Nov 2012 20:03:44 -0700 Subject: SH-3499 Ensure asset stats output is correct improvements to predicate API default rules encapsulated in LLInitParam removed empty flag from viewer asset stats --- indra/llcommon/llinitparam.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/llcommon/llinitparam.cpp') diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index 53254c3b56..d20fc03227 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -32,6 +32,12 @@ namespace LLInitParam { + + predicate_rule_t default_parse_rules() + { + return ll_make_predicate(PROVIDED) && !ll_make_predicate(EMPTY) && !ll_make_predicate(HAS_DEFAULT_VALUE); + } + // // Param // @@ -247,6 +253,10 @@ namespace LLInitParam } } + if (!serialized && predicate_rule.check(ll_make_predicate(EMPTY))) + { + serialized |= parser.writeValue(Flag(), name_stack); + } // was anything serialized in this block? return serialized; } -- cgit v1.2.3 From 0007114cf5a60779319ab8cbd0a23a0d462b8010 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 5 Nov 2012 16:10:57 -0800 Subject: SH-3499 WIP Ensure asset stats output is correct fixed copy behavior of recordings and accumulator buffers --- indra/llcommon/llinitparam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/llinitparam.cpp') diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index d20fc03227..32d4eec607 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -35,7 +35,7 @@ namespace LLInitParam predicate_rule_t default_parse_rules() { - return ll_make_predicate(PROVIDED) && !ll_make_predicate(EMPTY) && !ll_make_predicate(HAS_DEFAULT_VALUE); + return ll_make_predicate(PROVIDED) && !ll_make_predicate(EMPTY); } // -- cgit v1.2.3 From 9d77e030d9a0d23cebce616631677459eec1612c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 14 Nov 2012 23:52:27 -0800 Subject: SH-3406 WIP convert fast timers to lltrace system cleaning up build moved most includes of windows.h to llwin32headers.h to disable min/max macros, etc streamlined Time class and consolidated functionality in BlockTimer class llfasttimer is no longer included via llstring.h, so had to add it manually in several places --- indra/llcommon/llinitparam.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llcommon/llinitparam.cpp') diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index 32d4eec607..d72e10d2fa 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -28,6 +28,7 @@ #include "linden_common.h" #include "llinitparam.h" +#include "llformat.h" namespace LLInitParam -- cgit v1.2.3 From a2e22732f195dc075a733c79f15156752f522a43 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 30 Jul 2013 19:13:45 -0700 Subject: Summer cleaning - removed a lot of llcommon dependencies to speed up build times consolidated most indra-specific constants in llcommon under indra_constants.h fixed issues with operations on mixed unit types (implicit and explicit) made LL_INFOS() style macros variadic in order to subsume other logging methods such as ll_infos added optional tag output to error recorders --- indra/llcommon/llinitparam.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llcommon/llinitparam.cpp') diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index dbd4eba7a0..aa2f4eb289 100755 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -100,13 +100,13 @@ namespace LLInitParam void Parser::parserWarning(const std::string& message) { if (mParseSilently) return; - llwarns << message << llendl; + LL_WARNS() << message << LL_ENDL; } void Parser::parserError(const std::string& message) { if (mParseSilently) return; - llerrs << message << llendl; + LL_ERRS() << message << LL_ENDL; } @@ -131,7 +131,7 @@ namespace LLInitParam std::string name(char_name); if ((size_t)param->mParamHandle > mMaxParamOffset) { - llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block" << llendl; + LL_ERRS() << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block" << LL_ENDL; } if (name.empty()) @@ -214,7 +214,7 @@ namespace LLInitParam { if (emit_errors) { - llwarns << "Invalid param \"" << getParamName(block_data, param) << "\"" << llendl; + LL_WARNS() << "Invalid param \"" << getParamName(block_data, param) << "\"" << LL_ENDL; } return false; } @@ -417,7 +417,7 @@ namespace LLInitParam // Block if ((size_t)handle > block_data.mMaxParamOffset) { - llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block" << llendl; + LL_ERRS() << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block" << LL_ENDL; } ParamDescriptorPtr param_descriptor = findParamDescriptor(param); -- cgit v1.2.3