aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/file_io_server.erl
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2012-02-13 20:13:37 +0100
committerPatrik Nyblom <[email protected]>2012-03-22 18:16:14 +0100
commitc15f94e7922040b63f3abf8680cd77d5548fecf3 (patch)
tree498dd289cf85393a70d4f34ff20c59338fd24066 /lib/kernel/src/file_io_server.erl
parent0fd4e39abeea3fc87b78eec8495109f9245b5ac8 (diff)
downloadotp-c15f94e7922040b63f3abf8680cd77d5548fecf3.tar.gz
otp-c15f94e7922040b63f3abf8680cd77d5548fecf3.tar.bz2
otp-c15f94e7922040b63f3abf8680cd77d5548fecf3.zip
Add user tag spreading functionality to VM and use in file
User tags in a dynamic trace enabled VM are spread throughout the system in the same way as seq_trace tokens. This is used by the file module and various other modules to get hold of the tag from the user process without changing the protocol.
Diffstat (limited to 'lib/kernel/src/file_io_server.erl')
-rw-r--r--lib/kernel/src/file_io_server.erl15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/kernel/src/file_io_server.erl b/lib/kernel/src/file_io_server.erl
index cc0343031b..14da9c1a55 100644
--- a/lib/kernel/src/file_io_server.erl
+++ b/lib/kernel/src/file_io_server.erl
@@ -21,7 +21,7 @@
%% A simple file server for io to one file instance per server instance.
-export([format_error/1]).
--export([start/4, start_link/4]).
+-export([start/3, start_link/3]).
-export([count_and_find/3]).
@@ -43,18 +43,18 @@ format_error({_Line, Mod, Reason}) ->
format_error(ErrorId) ->
erl_posix_msg:message(ErrorId).
-start(Owner, FileName, ModeList, DTraceUtag)
+start(Owner, FileName, ModeList)
when is_pid(Owner), (is_list(FileName) orelse is_binary(FileName)), is_list(ModeList) ->
- do_start(spawn, Owner, FileName, ModeList, DTraceUtag).
+ do_start(spawn, Owner, FileName, ModeList).
-start_link(Owner, FileName, ModeList, DTraceUtag)
+start_link(Owner, FileName, ModeList)
when is_pid(Owner), (is_list(FileName) orelse is_binary(FileName)), is_list(ModeList) ->
- do_start(spawn_link, Owner, FileName, ModeList, DTraceUtag).
+ do_start(spawn_link, Owner, FileName, ModeList).
%%%-----------------------------------------------------------------
%%% Server starter, dispatcher and helpers
-do_start(Spawn, Owner, FileName, ModeList, DTraceUtag) ->
+do_start(Spawn, Owner, FileName, ModeList) ->
Self = self(),
Ref = make_ref(),
Pid =
@@ -63,12 +63,11 @@ do_start(Spawn, Owner, FileName, ModeList, DTraceUtag) ->
%% process_flag(trap_exit, true),
case parse_options(ModeList) of
{ReadMode, UnicodeMode, Opts} ->
- case ?PRIM_FILE:open(FileName, Opts, DTraceUtag) of
+ case ?PRIM_FILE:open(FileName, Opts) of
{error, Reason} = Error ->
Self ! {Ref, Error},
exit(Reason);
{ok, Handle} ->
- put(dtrace_utag, DTraceUtag), % TODO: API?
%% XXX must I handle R6 nodes here?
M = erlang:monitor(process, Owner),
Self ! {Ref, ok},