Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Side by Side Diff: src/pkg/runtime/race/race.go

Issue 7229044: code review 7229044: runtime: implement range access functions in race detector. (Closed)
Patch Set: diff -r 229081515358 https://go.googlecode.com/hg/ Created 12 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/runtime/race.c ('k') | src/pkg/runtime/race0.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Go Authors. All rights reserved. 1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // +build race,linux,amd64 race,darwin,amd64 race,windows,amd64 5 // +build race,linux,amd64 race,darwin,amd64 race,windows,amd64
6 6
7 // Package race provides low-level facilities for data race detection. 7 // Package race provides low-level facilities for data race detection.
8 package race 8 package race
9 9
10 /* 10 /*
11 void __tsan_init(void); 11 void __tsan_init(void);
12 void __tsan_fini(void); 12 void __tsan_fini(void);
13 void __tsan_map_shadow(void *addr, void *size); 13 void __tsan_map_shadow(void *addr, void *size);
14 void __tsan_go_start(int pgoid, int chgoid, void *pc); 14 void __tsan_go_start(int pgoid, int chgoid, void *pc);
15 void __tsan_go_end(int goid); 15 void __tsan_go_end(int goid);
16 void __tsan_read(int goid, void *addr, void *pc); 16 void __tsan_read(int goid, void *addr, void *pc);
17 void __tsan_write(int goid, void *addr, void *pc); 17 void __tsan_write(int goid, void *addr, void *pc);
18 void __tsan_read_range(int goid, void *addr, long sz, long step, void *pc);
19 void __tsan_write_range(int goid, void *addr, long sz, long step, void *pc);
18 void __tsan_func_enter(int goid, void *pc); 20 void __tsan_func_enter(int goid, void *pc);
19 void __tsan_func_exit(int goid); 21 void __tsan_func_exit(int goid);
20 void __tsan_malloc(int goid, void *p, long sz, void *pc); 22 void __tsan_malloc(int goid, void *p, long sz, void *pc);
21 void __tsan_free(void *p); 23 void __tsan_free(void *p);
22 void __tsan_acquire(int goid, void *addr); 24 void __tsan_acquire(int goid, void *addr);
23 void __tsan_release(int goid, void *addr); 25 void __tsan_release(int goid, void *addr);
24 void __tsan_release_merge(int goid, void *addr); 26 void __tsan_release_merge(int goid, void *addr);
25 void __tsan_finalizer_goroutine(int tid); 27 void __tsan_finalizer_goroutine(int tid);
26 */ 28 */
27 import "C" 29 import "C"
(...skipping 20 matching lines...) Expand all
48 } 50 }
49 51
50 func Read(goid int32, addr, pc uintptr) { 52 func Read(goid int32, addr, pc uintptr) {
51 C.__tsan_read(C.int(goid), unsafe.Pointer(addr), unsafe.Pointer(pc)) 53 C.__tsan_read(C.int(goid), unsafe.Pointer(addr), unsafe.Pointer(pc))
52 } 54 }
53 55
54 func Write(goid int32, addr, pc uintptr) { 56 func Write(goid int32, addr, pc uintptr) {
55 C.__tsan_write(C.int(goid), unsafe.Pointer(addr), unsafe.Pointer(pc)) 57 C.__tsan_write(C.int(goid), unsafe.Pointer(addr), unsafe.Pointer(pc))
56 } 58 }
57 59
60 func ReadRange(goid int32, addr, sz, step, pc uintptr) {
61 C.__tsan_read_range(C.int(goid), unsafe.Pointer(addr),
62 C.long(sz), C.long(step), unsafe.Pointer(pc))
63 }
64
65 func WriteRange(goid int32, addr, sz, step, pc uintptr) {
66 C.__tsan_write_range(C.int(goid), unsafe.Pointer(addr),
67 C.long(sz), C.long(step), unsafe.Pointer(pc))
68 }
69
58 func FuncEnter(goid int32, pc uintptr) { 70 func FuncEnter(goid int32, pc uintptr) {
59 C.__tsan_func_enter(C.int(goid), unsafe.Pointer(pc)) 71 C.__tsan_func_enter(C.int(goid), unsafe.Pointer(pc))
60 } 72 }
61 73
62 func FuncExit(goid int32) { 74 func FuncExit(goid int32) {
63 C.__tsan_func_exit(C.int(goid)) 75 C.__tsan_func_exit(C.int(goid))
64 } 76 }
65 77
66 func Malloc(goid int32, p, sz, pc uintptr) { 78 func Malloc(goid int32, p, sz, pc uintptr) {
67 C.__tsan_malloc(C.int(goid), unsafe.Pointer(p), C.long(sz), unsafe.Point er(pc)) 79 C.__tsan_malloc(C.int(goid), unsafe.Pointer(p), C.long(sz), unsafe.Point er(pc))
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 *off = C.int(pc) 113 *off = C.int(pc)
102 return 1 114 return 1
103 } 115 }
104 fi, l := f.FileLine(pc) 116 fi, l := f.FileLine(pc)
105 *fun = C.CString(f.Name()) 117 *fun = C.CString(f.Name())
106 *file = C.CString(fi) 118 *file = C.CString(fi)
107 *line = C.int(l) 119 *line = C.int(l)
108 *off = C.int(pc - f.Entry()) 120 *off = C.int(pc - f.Entry())
109 return 1 121 return 1
110 } 122 }
OLDNEW
« no previous file with comments | « src/pkg/runtime/race.c ('k') | src/pkg/runtime/race0.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b