Fix table column width; ntohl port numbers.

This commit is contained in:
Tom Wilkie
2015-09-18 07:38:12 +00:00
committed by Tom Wilkie
parent dfbd83b658
commit baf7aa106c
3 changed files with 20 additions and 9 deletions

View File

@@ -19,10 +19,6 @@ start_container() {
done
}
start_container 1 elasticsearch elasticsearch
start_container 2 tomwilkie/searchapp searchapp
start_container 1 redis redis
start_container 1 tomwilkie/qotd qotd
start_container 2 tomwilkie/app app
start_container 2 tomwilkie/frontend frontend --add-host=dns.weave.local:$(weave docker-bridge-ip)
start_container 1 tomwilkie/client client
start_container 1 tomwilkie/app app

View File

@@ -12,6 +12,7 @@ import (
const (
READ = 0
WRITE = 1
OPEN = 2
CLOSE = 3
STAT = 4
MMAP = 9
@@ -101,11 +102,18 @@ func (t *thread) syscallStopped() {
case SETROBUSTLIST, GETID, MMAP, MPROTECT, MADVISE, SOCKET, CLONE, STAT, SELECT:
return
case OPEN:
return
default:
t.logf("syscall(%d)", t.callRegs.Orig_rax)
}
}
func ntohl(b uint16) uint16 {
return (b << 8) | ((b & 0xff00) >> 8)
}
func (t *thread) getSocketAddress(ptr uintptr) (addr net.IP, port uint16, err error) {
var (
buf = make([]byte, syscall.SizeofSockaddrAny)
@@ -128,7 +136,7 @@ func (t *thread) getSocketAddress(ptr uintptr) (addr net.IP, port uint16, err er
}
addr = net.IP(sockaddr4.Addr[0:])
port = sockaddr4.Port
port = ntohl(sockaddr4.Port)
return
}

View File

@@ -273,8 +273,15 @@
<span class="fa fa-stop" aria-hidden="true"></span> Stop</button>
</div>
<table class="table table-striped table-sm">
<thead><tr><th>Start time</th><th>Duration</th><th>PID<th>From</th><th>To</th><th>Sub-traces</th></tr></thead>
<table class="table table-sm">
<thead><tr>
<th width="25%">Start time</th>
<th width="15%">Duration</th>
<th width="15%">PID</th>
<th width="15%">From</th>
<th width="15%">To</th>
<th width="15%">Sub-traces</th>
</tr></thead>
<tbody>
{{>traces traces}}
</tbody>