From ca4f6ad17ca4a79dedbb0260f9d95f348817f174 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Wed, 23 Mar 2016 16:17:01 +0000 Subject: [PATCH] Fix a couple of minor issue for goreportcard and add badge for it. --- README.md | 2 +- experimental/sniff/testclient/main.go | 4 ++++ experimental/tracer/ptrace/ptracer.go | 9 +++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d4a9f97315..5edf010427 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Scope -[![Circle CI](https://circleci.com/gh/weaveworks/scope/tree/master.svg?style=shield)](https://circleci.com/gh/weaveworks/scope/tree/master) [![Coverage Status](https://coveralls.io/repos/weaveworks/scope/badge.svg)](https://coveralls.io/r/weaveworks/scope) [![Slack Status](https://weave-scope-slack.herokuapp.com/badge.svg)](https://weave-scope-slack.herokuapp.com) +[![Circle CI](https://circleci.com/gh/weaveworks/scope/tree/master.svg?style=shield)](https://circleci.com/gh/weaveworks/scope/tree/master) [![Coverage Status](https://coveralls.io/repos/weaveworks/scope/badge.svg)](https://coveralls.io/r/weaveworks/scope) [![Slack Status](https://weave-scope-slack.herokuapp.com/badge.svg)](https://weave-scope-slack.herokuapp.com) [![Go Report Card](https://goreportcard.com/badge/github.com/weaveworks/scope)](https://goreportcard.com/report/github.com/weaveworks/scope) Weave Scope automatically generates a map of your application, enabling you to intuitively understand, monitor, and control your containerized, microservices based application. diff --git a/experimental/sniff/testclient/main.go b/experimental/sniff/testclient/main.go index 8b568ad4fd..a1eb9b3436 100644 --- a/experimental/sniff/testclient/main.go +++ b/experimental/sniff/testclient/main.go @@ -62,6 +62,10 @@ func main() { } log.Println(ci.Timestamp.String()) err = parser.DecodeLayers(data, &decoded) + if err != nil { + log.Printf("Error in DecodeLayers: %v", err) + continue + } for _, t := range decoded { switch t { case layers.LayerTypeEthernet: diff --git a/experimental/tracer/ptrace/ptracer.go b/experimental/tracer/ptrace/ptracer.go index 81fabad8ee..5d8a5db64b 100644 --- a/experimental/tracer/ptrace/ptracer.go +++ b/experimental/tracer/ptrace/ptracer.go @@ -76,15 +76,16 @@ func (t *PTracer) Stop() { } // TraceProcess starts tracing the given pid -func (t *PTracer) TraceProcess(pid int) *process { - result := make(chan *process) +func (t *PTracer) TraceProcess(pid int) { + result := make(chan struct{}) t.ops <- func() { process := newProcess(pid, t) t.processes[pid] = process process.trace() - result <- process + result <- struct{}{} } - return <-result + <-result + return } // StopTracing stops tracing all threads for the given pid