Lines Matching refs:id

36 #define log_buffer_size(id) mMaxSize[id]
290 void LogBuffer::maybePrune(log_id_t id) {
291 size_t sizes = stats.sizes(id);
292 unsigned long maxSize = log_buffer_size(id);
295 size_t elements = stats.realElements(id);
307 prune(id, pruneRows);
314 log_id_t id = element->getLogId();
321 mLastWorstUid[id].find(element->getUid());
322 if ((found != mLastWorstUid[id].end())
324 mLastWorstUid[id].erase(found);
331 mLastWorstPidOfSystem[id].find(element->getPid());
332 if ((found != mLastWorstPidOfSystem[id].end())
334 mLastWorstPidOfSystem[id].erase(found);
443 // prune "pruneRows" of type "id" from the buffer.
478 // (again, remember for the specified log buffer id) but does some whitelist
490 bool LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
501 if (entry->owned_Locked() && entry->isWatching(id)
515 it = mLastSet[id] ? mLast[id] : mLogElements.begin();
519 if ((element->getLogId() != id) || (element->getUid() != caller_uid)) {
524 if (!mLastSet[id] || ((*mLast[id])->getLogId() != id)) {
525 mLast[id] = it;
526 mLastSet[id] = true;
534 oldest->triggerSkip_Locked(id, pruneRows);
547 bool hasBlacklist = (id != LOG_ID_SECURITY) && mPrune.naughty();
555 if (worstUidEnabledForLogid(id) && mPrune.worstUidEnabled()) {
558 AID_ROOT, (pid_t)0, 2, id);
563 size_t threshold = log_buffer_size(id) / 8;
580 worst, (pid_t)0, 2, id, worst);
597 it = mLastSet[id] ? mLast[id] : mLogElements.begin();
605 LogBufferIteratorMap::iterator found = mLastWorstUid[id].find(worst);
606 if ((found != mLastWorstUid[id].end())
615 = mLastWorstPidOfSystem[id].find(worstPid);
616 if ((found != mLastWorstPidOfSystem[id].end())
641 if (element->getLogId() != id) {
645 // below this point element->getLogId() == id
647 if (leading && (!mLastSet[id] || ((*mLast[id])->getLogId() != id))) {
648 mLast[id] = it;
649 mLastSet[id] = true;
696 || (mLastWorstPidOfSystem[id].find(element->getPid())
697 == mLastWorstPidOfSystem[id].end()))) {
700 mLastWorstPidOfSystem[id][element->getPid()] = it;
703 || (mLastWorstUid[id].find(element->getUid())
704 == mLastWorstUid[id].end())) {
705 mLastWorstUid[id][element->getUid()] = it;
741 || (mLastWorstPidOfSystem[id].find(worstPid)
742 == mLastWorstPidOfSystem[id].end()))) {
745 mLastWorstPidOfSystem[id][worstPid] = it;
747 if ((!gc && !worstPid) || (mLastWorstUid[id].find(worst)
748 == mLastWorstUid[id].end())) {
749 mLastWorstUid[id][worst] = it;
767 bool hasWhitelist = (id != LOG_ID_SECURITY) && mPrune.nice() && !clearAll;
768 it = mLastSet[id] ? mLast[id] : mLogElements.begin();
772 if (element->getLogId() != id) {
777 if (!mLastSet[id] || ((*mLast[id])->getLogId() != id)) {
778 mLast[id] = it;
779 mLastSet[id] = true;
788 if (stats.sizes(id) > (2 * log_buffer_size(id))) {
794 oldest->triggerSkip_Locked(id, pruneRows);
812 it = mLastSet[id] ? mLast[id] : mLogElements.begin();
816 if (element->getLogId() != id) {
821 if (!mLastSet[id] || ((*mLast[id])->getLogId() != id)) {
822 mLast[id] = it;
823 mLastSet[id] = true;
828 if (stats.sizes(id) > (2 * log_buffer_size(id))) {
834 oldest->triggerSkip_Locked(id, pruneRows);
849 // clear all rows of type "id" from the buffer.
850 bool LogBuffer::clear(log_id_t id, uid_t uid) {
860 busy = prune(id, 1, uid);
872 if (entry->owned_Locked() && entry->isWatching(id)) {
881 busy = prune(id, ULONG_MAX, uid);
891 // get the used space associated with "id".
892 unsigned long LogBuffer::getSizeUsed(log_id_t id) {
894 size_t retval = stats.sizes(id);
899 // set the total space allocated to "id"
900 int LogBuffer::setSize(log_id_t id, unsigned long size) {
906 log_buffer_size(id) = size;
911 // get the total space allocated to "id"
912 unsigned long LogBuffer::getSize(log_id_t id) {
914 size_t retval = log_buffer_size(id);