moved some Debug msgs to Trace
Some checks are pending
Build status / Build (push) Waiting to run

This commit is contained in:
Gustavo Iñiguez Goia 2025-03-03 21:35:31 +01:00
parent dcb1157365
commit 8d1a7de0cc
Failed to generate hash of commit
3 changed files with 14 additions and 14 deletions

View file

@ -277,7 +277,7 @@ func worker(id int) {
default:
pkt, ok := <-wrkChan
if !ok {
log.Debug("worker channel closed %d", id)
log.Trace("worker channel closed %d", id)
goto Exit
}
onPacket(pkt)
@ -346,21 +346,21 @@ func initSystemdResolvedMonitor() {
continue
}
/*for i, q := range response.Question {
log.Debug("%d SYSTEMD RESPONSE Q: %s", i, q.Name)
log.Trace("[DNS] %d systemd response, question: %s", i, q.Name)
}*/
for i, a := range response.Answer {
if a.RR.Key.Type != systemd.DNSTypeA &&
a.RR.Key.Type != systemd.DNSTypeAAAA &&
a.RR.Key.Type != systemd.DNSTypeCNAME {
log.Debug("systemd-resolved, excluding answer: %#v", a)
log.Trace("systemd-resolved, excluding answer: %#v", a)
continue
}
ip = net.IP(a.RR.Address)
log.Debug("%d systemd-resolved monitor response: %s -> %s", i, a.RR.Key.Name, ip)
if a.RR.Key.Type == systemd.DNSTypeCNAME {
log.Debug("systemd-resolved CNAME >> %s -> %s", a.RR.Name, a.RR.Key.Name)
dns.Track(a.RR.Name, a.RR.Key.Name /*domain*/)
} else {
ip = net.IP(a.RR.Address)
log.Debug("%d systemd-resolved monitor response: %s -> %s", i, a.RR.Key.Name, ip)
dns.Track(ip.String(), a.RR.Key.Name /*domain*/)
}
}

View file

@ -91,12 +91,12 @@ func (e *EventsStore) Add(proc *Process) {
e.UpdateItem(proc)
}
}
log.Debug("[cache] EventsStore.Add() finished %s, %s", proc.Path, proc.Tree)
log.Debug("[cache] EventsStore.Add() finished %d, %s, %s", proc.ID, proc.Path, proc.Tree)
}
// UpdateItem updates a cache item
func (e *EventsStore) UpdateItem(proc *Process) {
log.Debug("[cache] updateItem() updating events store (total: %d), pid: %d, path: %s, %v", e.Len(), proc.ID, proc.Path, proc.Tree)
log.Trace("[cache] updateItem() updating events store (total: %d), pid: %d, path: %s, %v", e.Len(), proc.ID, proc.Path, proc.Tree)
if proc.Path == "" {
return
}
@ -111,7 +111,7 @@ func (e *EventsStore) UpdateItem(proc *Process) {
// ReplaceItem replaces an existing process with a new one.
func (e *EventsStore) ReplaceItem(oldProc, newProc *Process) {
log.Debug("[event inCache, replacement] new: %d, %s -> inCache: %d -> %s - Trees: %s, %s", newProc.ID, newProc.Path, oldProc.ID, oldProc.Path, oldProc.Tree, newProc.Tree)
log.Trace("[event inCache, replacement] new: %d, %s -> inCache: %d -> %s - Trees: %s, %s", newProc.ID, newProc.Path, oldProc.ID, oldProc.Path, oldProc.Tree, newProc.Tree)
// Note: in rare occasions, the process being replaced is the older one.
// if oldProc.Starttime > newProc.Starttime {}
//
@ -165,11 +165,11 @@ func (e *EventsStore) Update(oldProc, proc *Process) {
}
if updateOld {
log.Debug("[cache] Update end, updating oldProc: %d, %s, %v", oldProc.ID, oldProc.Path, oldProc.Tree)
log.Trace("[cache] Update end, updating oldProc: %d, %s, %v", oldProc.ID, oldProc.Path, oldProc.Tree)
e.UpdateItem(oldProc)
}
if update {
log.Debug("[cache] Update end, updating newProc: %d, %s, %v", proc.ID, proc.Path, proc.Tree)
log.Trace("[cache] Update end, updating newProc: %d, %s, %v", proc.ID, proc.Path, proc.Tree)
e.UpdateItem(proc)
}
}
@ -263,7 +263,7 @@ func (e *EventsStore) Delete(key int) {
e.mu.Lock()
defer e.mu.Unlock()
if !ev.Proc.IsAlive() {
log.Debug("[cache delete] deleted %d: %s", key, ev.Proc.Path)
log.Trace("[cache delete] deleted %d: %s", key, ev.Proc.Path)
delete(e.eventByPID, key)
}
})
@ -280,7 +280,7 @@ func (e *EventsStore) DeleteOldItems() {
log.Debug("[cache] deleting old events, total byPID: %d", len(e.eventByPID))
for k, item := range e.eventByPID {
if !item.isValid() && !item.Proc.IsAlive() {
log.Debug("[cache] deleting old item: %d", k)
log.Trace("[cache] deleting old item: %d", k)
delete(e.eventByPID, k)
}
}

View file

@ -59,7 +59,7 @@ func byteArrayToString(arr []byte) string {
func deleteEbpfEntry(proto string, key unsafe.Pointer) bool {
if err := m.DeleteElement(ebpfMaps[proto].bpfmap, key); err != nil {
log.Debug("error deleting ebpf entry: %s", err)
log.Trace("error deleting ebpf entry: %s", err)
return false
}
return true
@ -88,7 +88,7 @@ func getItems(proto string, isIPv6 bool) (items uint) {
ok, err := m.LookupNextElement(mp.bpfmap, unsafe.Pointer(&lookupKey[0]),
unsafe.Pointer(&nextKey[0]), unsafe.Pointer(&value))
if !ok || err != nil { //reached end of map
log.Debug("[ebpf] %s map: %d active items", proto, items)
log.Trace("[ebpf] %s map: %d active items", proto, items)
return
}
if firstrun {