Lines Matching refs:log_id
52 log_id_t log_id, LogStatistics* stats) REQUIRES(logd_lock) { in ClearLogsByUid() argument
58 chunk->NotifyReadersOfPrune(log_id); in ClearLogsByUid()
81 stats->Subtract(entry.ToLogStatisticsElement(log_id)); in ClearLogsByUid()
114 bool SerializedLogBuffer::ShouldLog(log_id_t log_id, const char* msg, uint16_t len) { in ShouldLog() argument
115 if (log_id == LOG_ID_SECURITY) { in ShouldLog()
122 if (IsBinary(log_id)) { in ShouldLog()
136 int SerializedLogBuffer::Log(log_id_t log_id, log_time realtime, uid_t uid, pid_t pid, pid_t tid, in Log() argument
138 if (log_id >= LOG_ID_MAX || len == 0) { in Log()
146 if (!ShouldLog(log_id, msg, len)) { in Log()
147 stats_->AddTotal(log_id, len); in Log()
154 auto entry = LogToLogBuffer(logs_[log_id], max_size_[log_id], sequence, realtime, uid, pid, tid, in Log()
156 stats_->Add(entry->ToLogStatisticsElement(log_id)); in Log()
158 MaybePrune(log_id); in Log()
160 reader_list_->NotifyNewLog(1 << log_id); in Log()
164 void SerializedLogBuffer::MaybePrune(log_id_t log_id) { in MaybePrune() argument
165 size_t total_size = GetSizeUsed(log_id); in MaybePrune()
167 if (total_size > max_size_[log_id]) { in MaybePrune()
168 Prune(log_id, total_size - max_size_[log_id]); in MaybePrune()
169 after_size = GetSizeUsed(log_id); in MaybePrune()
170 LOG(VERBOSE) << "Pruned Logs from log_id: " << log_id << ", previous size: " << total_size in MaybePrune()
174 stats_->set_overhead(log_id, after_size); in MaybePrune()
177 void SerializedLogBuffer::RemoveChunkFromStats(log_id_t log_id, SerializedLogChunk& chunk) { in RemoveChunkFromStats() argument
180 stats_->Subtract(entry.ToLogStatisticsElement(log_id)); in RemoveChunkFromStats()
185 void SerializedLogBuffer::Prune(log_id_t log_id, size_t bytes_to_free) { in Prune() argument
186 auto& log_buffer = logs_[log_id]; in Prune()
190 if (!reader_thread->IsWatching(log_id)) { in Prune()
220 it_to_prune->NotifyReadersOfPrune(log_id); in Prune()
223 RemoveChunkFromStats(log_id, *it_to_prune); in Prune()
232 void SerializedLogBuffer::UidClear(log_id_t log_id, uid_t uid) { in UidClear() argument
235 if (!reader_thread->IsWatching(log_id)) { in UidClear()
243 ClearLogsByUid(logs_[log_id], uid, max_size_[log_id], log_id, stats_); in UidClear()
253 const std::function<FilterResult(log_id_t log_id, pid_t pid, uint64_t sequence, in FlushTo() argument
260 auto log_id = top.log_id; in FlushTo() local
272 auto ret = filter(log_id, entry->pid(), entry->sequence(), entry->realtime()); in FlushTo()
289 if (!reinterpret_cast<SerializedLogEntry*>(entry_copy)->Flush(writer, log_id)) { in FlushTo()