Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\tracing_map.c Create Date:2022-07-28 12:07:28
Last Modify:2020-03-17 19:44:05 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__tracing_map_insert

Proto:static inline struct tracing_map_elt *__tracing_map_insert(struct tracing_map *map, void *key, bool lookup_only)

Type:struct tracing_map_elt

Parameter:

TypeParameterName
struct tracing_map *map
void *key
boollookup_only
516  dup_try = 0
520  key_hash = jhash - hash an arbitrary key*@k: sequence of bytes as key*@length: the length of the key*@initval: the previous hash, or an arbitray value* The generic version, hashes an arbitrary sequence of bytes.
521  If key_hash == 0 Then key_hash = 1
523  idx = key_hash >> 32 - map_bits + 1
525  When 1 cycle
526  idx &= map_size - 1
527  entry = TRACING_MAP_ENTRY(map, idx)
528  test_key = key
530  If test_key && test_key == key_hash Then
531  val = READ_ONCE(val)
532  If val && keys_match(key, key, key_size) Then
534  If Not lookup_only Then atomic64_inc( & hits)
536  Return val
550  dup_try++
551  If dup_try > map_size Then
552  atomic64_inc( & drops)
553  Break
555  Continue
559  If Not test_key Then
560  If lookup_only Then Break
563  If Not cmpxchg( & key, 0, key_hash) Then
566  elt = get_free_elt(map)
567  If Not elt Then
568  atomic64_inc( & drops)
569  key = 0
570  Break
574  val = elt
575  atomic64_inc( & hits)
577  Return val
578  Else
583  dup_try++
584  Continue
588  idx++
591  Return NULL
Caller
NameDescribe
tracing_map_insertracing_map_insert - Insert key and/or retrieve val from a tracing_map*@map: The tracing_map to insert into*@key: The key to insert* Inserts a key into a tracing_map and creates and returns a new* tracing_map_elt for it, or if the key has already been
tracing_map_lookupracing_map_lookup - Retrieve val from a tracing_map*@map: The tracing_map to perform the lookup on*@key: The key to look up* Looks up key in tracing_map and if found returns the matching* tracing_map_elt. This is a lock-free lookup; see