Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
codes
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
38
Issues
38
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
codes
codes
Commits
b98deb14
Commit
b98deb14
authored
Mar 05, 2015
by
Jonathan Jenkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lsm api switch to use annotations
parent
5af2ef2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
36 deletions
+83
-36
codes/local-storage-model.h
codes/local-storage-model.h
+19
-1
src/util/local-storage-model.c
src/util/local-storage-model.c
+64
-35
No files found.
codes/local-storage-model.h
View file @
b98deb14
...
@@ -43,7 +43,10 @@ typedef enum lsm_event_e
...
@@ -43,7 +43,10 @@ typedef enum lsm_event_e
*/
*/
/* given LP sender, find the LSM device LP in the same group */
/* given LP sender, find the LSM device LP in the same group */
tw_lpid
lsm_find_local_device
(
tw_lp
*
sender
);
tw_lpid
lsm_find_local_device
(
const
char
*
annotation
,
int
ignore_annotations
,
tw_lpid
sender_gid
);
/*
/*
* lsm_event_new
* lsm_event_new
...
@@ -69,6 +72,21 @@ tw_event* lsm_event_new(const char* category,
...
@@ -69,6 +72,21 @@ tw_event* lsm_event_new(const char* category,
size_t
message_bytes
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_lp
*
sender
,
tw_stime
delay
);
tw_stime
delay
);
/* equivalent to lsm_event_new, except it allows to specify an annotation to
* filter by. If ignore_annotations is nonzero, A null annotation parameter
* indicates that the lsm LP to issue to has no annotation */
tw_event
*
lsm_event_new_annotated
(
const
char
*
category
,
tw_lpid
dest_gid
,
uint64_t
io_object
,
int64_t
io_offset
,
uint64_t
io_size_bytes
,
int
io_type
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_stime
delay
,
const
char
*
annotation
,
int
ignore_annotations
);
void
lsm_event_new_reverse
(
tw_lp
*
sender
);
void
lsm_event_new_reverse
(
tw_lp
*
sender
);
...
...
src/util/local-storage-model.c
View file @
b98deb14
...
@@ -266,42 +266,26 @@ static tw_lpid lsm_find_local_device_default(
...
@@ -266,42 +266,26 @@ static tw_lpid lsm_find_local_device_default(
return
rtn
;
return
rtn
;
}
}
/*
tw_lpid
lsm_find_local_device
(
* lsm_find_local_device()
const
char
*
annotation
,
*
int
ignore_annotations
,
* returns the LP id of the lsm device connected to the caller
tw_lpid
sender_gid
)
{
*
return
lsm_find_local_device_default
(
annotation
,
ignore_annotations
,
* TODO: currently ignores annotations
sender_gid
);
*/
tw_lpid
lsm_find_local_device
(
tw_lp
*
sender
)
{
return
lsm_find_local_device_default
(
NULL
,
1
,
sender
->
gid
);
}
}
/*
static
tw_event
*
lsm_event_new_base
(
* lsm_event_new
const
char
*
category
,
* - creates a new event that is targeted for the corresponding
tw_lpid
dest_gid
,
* LSM LP.
uint64_t
io_object
,
* - this event will allow wrapping the callers completion event
int64_t
io_offset
,
* - category: string name to identify the traffic category
uint64_t
io_size_bytes
,
* - dest_gid: the gid to send the callers event to
int
io_type
,
* - gid_offset: relative offset of the LSM LP to the originating LP
size_t
message_bytes
,
* - io_object: id of byte stream the caller will modify
tw_lp
*
sender
,
* - io_offset: offset into byte stream
tw_stime
delay
,
* - io_size_bytes: size in bytes of IO request
const
char
*
annotation
,
* - io_type: read or write request
int
ignore_annotations
)
* - message_bytes: size of the event message the caller will have
* - sender: id of the sender
*/
tw_event
*
lsm_event_new
(
const
char
*
category
,
tw_lpid
dest_gid
,
uint64_t
io_object
,
int64_t
io_offset
,
uint64_t
io_size_bytes
,
int
io_type
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_stime
delay
)
{
{
tw_event
*
e
;
tw_event
*
e
;
lsm_message_t
*
m
;
lsm_message_t
*
m
;
...
@@ -314,7 +298,7 @@ tw_event* lsm_event_new(const char* category,
...
@@ -314,7 +298,7 @@ tw_event* lsm_event_new(const char* category,
/* Generate an event for the local storage model, and send the
/* Generate an event for the local storage model, and send the
* event to an lsm LP.
* event to an lsm LP.
*/
*/
lsm_gid
=
lsm_find_local_device
(
sender
);
lsm_gid
=
lsm_find_local_device
(
annotation
,
ignore_annotations
,
sender
->
gid
);
delta
=
codes_local_latency
(
sender
)
+
delay
;
delta
=
codes_local_latency
(
sender
)
+
delay
;
if
(
lsm_in_sequence
)
{
if
(
lsm_in_sequence
)
{
...
@@ -338,6 +322,51 @@ tw_event* lsm_event_new(const char* category,
...
@@ -338,6 +322,51 @@ tw_event* lsm_event_new(const char* category,
return
e
;
return
e
;
}
}
/*
* lsm_event_new
* - creates a new event that is targeted for the corresponding
* LSM LP.
* - this event will allow wrapping the callers completion event
* - category: string name to identify the traffic category
* - dest_gid: the gid to send the callers event to
* - gid_offset: relative offset of the LSM LP to the originating LP
* - io_object: id of byte stream the caller will modify
* - io_offset: offset into byte stream
* - io_size_bytes: size in bytes of IO request
* - io_type: read or write request
* - message_bytes: size of the event message the caller will have
* - sender: id of the sender
*/
tw_event
*
lsm_event_new
(
const
char
*
category
,
tw_lpid
dest_gid
,
uint64_t
io_object
,
int64_t
io_offset
,
uint64_t
io_size_bytes
,
int
io_type
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_stime
delay
)
{
return
lsm_event_new_base
(
category
,
dest_gid
,
io_object
,
io_offset
,
io_size_bytes
,
io_type
,
message_bytes
,
sender
,
delay
,
NULL
,
1
);
}
tw_event
*
lsm_event_new_annotated
(
const
char
*
category
,
tw_lpid
dest_gid
,
uint64_t
io_object
,
int64_t
io_offset
,
uint64_t
io_size_bytes
,
int
io_type
,
size_t
message_bytes
,
tw_lp
*
sender
,
tw_stime
delay
,
const
char
*
annotation
,
int
ignore_annotations
)
{
return
lsm_event_new_base
(
category
,
dest_gid
,
io_object
,
io_offset
,
io_size_bytes
,
io_type
,
message_bytes
,
sender
,
delay
,
annotation
,
ignore_annotations
);
}
/*
/*
* lsm_event_data
* lsm_event_data
* - returns the pointer to the message data for the callers data
* - returns the pointer to the message data for the callers data
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment