Hmmm, I think you'd better match pid exactly by ```grep -w```
```"ps -o cpuid,pid -eL | grep -w %s" % pid```
what do you think?