Make trace go through a class

How to make trace filter self and everything with same class?
[lua]
local tracedata = {}
tracedata.filter = self
local trace = util.TraceLine(tracedata)
[/lua]

Afaik you need to add all entities of said class to the filter.