File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -1360,6 +1360,8 @@ static bool is_c_func_name(const char *name)
1360
1360
*
1361
1361
* SRC[:SLN[+NUM|-ELN]]
1362
1362
* FNC[@SRC][:SLN[+NUM|-ELN]]
1363
+ *
1364
+ * FNC@SRC accepts `FNC@*` which forcibly specify FNC as function name.
1363
1365
*/
1364
1366
int parse_line_range_desc (const char * arg , struct line_range * lr )
1365
1367
{
@@ -1415,13 +1417,21 @@ int parse_line_range_desc(const char *arg, struct line_range *lr)
1415
1417
1416
1418
file = strpbrk_esc (name , "@" );
1417
1419
if (file ) {
1418
- * file = '\0' ;
1419
- lr -> file = strdup (++ file );
1420
- if (lr -> file == NULL ) {
1421
- err = - ENOMEM ;
1420
+ * file ++ = '\0' ;
1421
+ if (strcmp (file , "*" )) {
1422
+ lr -> file = strdup_esc (file );
1423
+ if (lr -> file == NULL ) {
1424
+ err = - ENOMEM ;
1425
+ goto err ;
1426
+ }
1427
+ }
1428
+ if (* name != '\0' )
1429
+ lr -> function = name ;
1430
+ if (!lr -> function && !lr -> file ) {
1431
+ semantic_error ("Only '@*' is not allowed.\n" );
1432
+ err = - EINVAL ;
1422
1433
goto err ;
1423
1434
}
1424
- lr -> function = name ;
1425
1435
} else if (strpbrk_esc (name , "/." ))
1426
1436
lr -> file = name ;
1427
1437
else if (is_c_func_name (name ))/* We reuse it for checking funcname */
@@ -1622,6 +1632,8 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
1622
1632
semantic_error ("SRC@SRC is not allowed.\n" );
1623
1633
return - EINVAL ;
1624
1634
}
1635
+ if (!strcmp (arg , "*" ))
1636
+ break ;
1625
1637
pp -> file = strdup_esc (arg );
1626
1638
if (pp -> file == NULL )
1627
1639
return - ENOMEM ;
You can’t perform that action at this time.
0 commit comments